Access 2010 requests parameter value during report assembly - report

I know this is a common problem with various queries and I have been through this report several hundred times trying to fix it. When I attempt to preview the report titled, "RTK Report", I am prompted by Access for a value for "Inventory2013", the table containing the primary data for the report. This only happens, however, 1.) When I include a subreport titled, "Product Components Subreport" and 2.) Only after I've established the linking field, "ProductID", between the main report and the subreport. Link to sample database HERE.

The problem you are having appears to be cause by the fact you are linking a subform to your detail section with an ambiguous name of "ProductID". I got it to work by doing the following:
In the RecordSource for the main form, I changed the query SQL for column PropertyId to be "SELECT Inventory2013.PRODUCTID AS MainID,"
Since this will break the MASTER and CHILD links, I then modified the MASTER to be "MainID" and the CHILD to be "Product_ID"
After that change, the report runs and does not prompt you.

Related

Get Requsition ID based on PO

In FSCM I am looking to modify the Search view on Add/Update PO page (Main Menu--> Purchasing--> Purchase Orders--> Add/Update POs) to display the Requisition ID associated with the PO in the search results page. The only table I have found that has both PO_ID and REQ_ID is PS_PO_LINE_DISTRIB however unless I use a SELECT DISTINCT clause I will get multiple PO_ID rows when there are more than 1 line on a PO.
Within Purchase Order Inquiry you can see the related Requisition ID's related to a PO by clicking on Document Status link inside the Purchase Order inquiry details page.
I started looking at the PeopleCode within the the Purchase Order Inquiry to see how they are linking the PO to a Requisition and it appears to use work tables with related PeopleCode function libraries, but I wasn't able to figure our how they get linked. I am hoping someone else may know the answer to this. Thank you.
I'm on an old version of PeopleSoft (SCM 8.80, Tools 8.51), so your mileage may vary. I'm assuming you're familiar with App Designer. If not, comment below and I'll add some details about what I'm clicking on.
Find the name of the Add/Update PO component.
Open the PURCHASE_ORDER component in App Designer. Now let's find the name of the search record. Note that there is a different record for the Add Search Record, so if you want to change that too, do all of this for that record as well.
Open the PO_SRCH record, and add the REQ_ID field to it. Make sure you mark the field as a key. You should consider saving your modified PO_SRCH under a new name in case you want to be able to revert to vanilla PeopleSoft. If you do, change the Search Record in the component to your new record name.
We can see that PO_SRCH is a view. So let's modify the view to pull in REQ_ID from PO_LINE_DISTRIB. As you mentioned above, there doesn't appear to be another table with both PO_ID and REQ_ID, so you'll have to do a SELECT DISTINCT.
We should do a LEFT OUTER JOIN instead of a standard join because if you do a standard join and you enter a purchase order with no lines and save it, then you'll never be able to retrieve that purchase order in this window. Since REQ_ID is a key field, we can't have a null, so we have to do the CASE.
One odd thing that I ran into here was building the view now gave me an error about selecting fewer columns in the SQL than I had in my record definition. I solved it by modifying the view for SQL Server. I've never had to do that before and I don't know why I had to do it for this specific record. But anyway, I entered the same SQL under the record's "Microsoft SQL Server" definition.
In the properties of PO_SRCH, we can see that it has a related language record. If you're only using one language, you can probably get away without changing this, but I'll do it for completeness. Open PO_SRCHLN. Now add REQ_ID to it (mark it as a key field like you did above), and save it as PO_SRCHLN2 (I'm saving it under a new name so I don't break anything else that may be using PO_SRCHLN).
Edit the SQL the same was as you did above. Note: I didn't have to also change the Microsoft SQL Server definition like I did above. I have no idea why.
Now build PO_SRCHLN2.
Go back to PO_SRCH and change its related language record to PO_SRCHLN2.
Now build PO_SRCH.
Hopefully you didn't get any errors and your search page has the requisition ID in it now. My system doesn't use requisitions so they're all blank in the example below, but the new field is there.

Selecting Sql Data Source Column Value to Variable (VB.NET)

I have a SqlDataSource, defined in the Master Page, that gets the current user permissions for the web application Select * from portal_users where userid = #userid, where portal_users is a view i built with all the data needed. I need to access the contents on the returned row so I can disable/enable site features according to the user permissions. This results in a lot of if blocks across the child pages to do it.
I browsed around forums and I only found issues about assigning those values to controls like i.e. label. Is there a way to access the SqlDataSource from the Master Page, get the row that is returned, select 1 or more column's values and assign them to variables?
Hy
It's not a good idea, use Master Page to share Data Source connections
Read this post to help you:
http://forums.asp.net/t/1188088.aspx?sql+data+source+in+Master+Page
Regards

SSRS Sub-Report only using default parameter to create dataset, even though parameter is successfully being passed from the main report

I have been working with SSRS for the last year and a half or so. Everything I know from it has been learned by trial and error and google. So hopefully I get my terminology correct, but forgive me if I say something incorrectly.
I am using Visual Studios 2015, connecting to SQL 2012 server. I'm creating an asp.net/VB web application to display SSRS reports on a local site. All of my reports up to this point have been a single report with no sub-report. If "sup-report data" was desired, I created a drill-through, using an Action, to navigate to a completely separate page. This has been working really well for all my reports, but now I would like to get a little fancier.
I have been trying to create a SSRS report that contains a sub-report. The main report contains summary information about batches of a particular product that has been run (blue and white portion of the table in the picture).
If a user wants to view more specific details about the batch, they can click on the expand/collapse button of the "Process Order" column, and a sub-report below the summary line will appear with more specific information about the batch (sub report is the light grey/dark grey table).
I configured the properties on the main report to pass the ProcessOrder value as a parameter on the sub-report and create a parameter on the sub report to accept this parameter.
You can tell that this parameter is being passed successfully because I have the respective parameter being passed and displayed just above the table (and it matches the number on the main table). As you can see from the picture, I also have the Process Order number displayed on the sub-report table itself, and this number is different than what is being passed to the report. It is showing a "1", which is the default value that I gave to the SQLDataSource control on my aspx page to build the dataset. I've tried not setting a "Default value" but then I get the following error:
“Data retrieval failed for the subreport, 'test_Sub_Report2', located at: [location on hard drive] Please check the log files for more information.”
Has anyone encountered this problem before, or can anyone give me an idea of a direction to go from here? I feel like I’m very close since I’m getting the parameter successfully passed to the sub-report, but the dataset is just not using that parameter to go get the data from SQL, and I’m not sure how to tell it to do so.
I can add more details and post more of the actual code, just let me know what you need and I will do my best to get it to you. I would have included more screenshots, but I don't have enough rep points to do so yet.
You need to go into the DataSet that populates the sub-report, and go to the Parameters tab, and map the ProcessOrder parameter of the dataset to the Variable that you pass the ProcessOrder parameter to from the main report.
I ended up figuring out the answer. I used the answer from #Lazy Coder on this question: SubReport is not working after adding parameter I was adding the parameters to the sub-report incorrectly. I did have them passed to the sub-report through the table on my main report, which was getting the parameters to the sub-report, but the sub-report was not using these values to create the data set. On my test_page.aspx.vb file I had to change my SubReportProcessing Event Handler. I needed to explicitly set the parameters values there. Since the time that I originally posted this question, I added another parameter to my stored procedure as well, subTotalTime, to correctly filter my results.
Public Sub SetSubDataSource(sender As Object, e As SubreportProcessingEventArgs)
Dim report = DirectCast(sender, LocalReport).DataSources(0)
Dim subProcessOrder = e.Parameters("subProcessOrder").Values(0)
Dim subTotalTime = e.Parameters("subTotalTime").Values(0)
SqlDataSource_PPMS_test_Sub_Page.SelectParameters(1).DefaultValue = subProcessOrder
SqlDataSource_PPMS_test_Sub_Page.SelectParameters(2).DefaultValue = subTotalTime
e.DataSources.Add(New ReportDataSource("DataSet2", SqlDataSource_PPMS_test_Sub_Page))
End Sub
SqlDataSource_PPMS_test_Sub_Page is the id of my SqlDataSource object on my aspx page.

Error 3022 Cannot add a duplicate value because of a key constrain

I am trying to insert a value into a table and i am getting an error 3022(It says that there might be a problem with a relation, a key or index). I have not created the table myself but i found out the specific column that triggers the error. I have checked that its not a key, index and there is not a relation to that table that depends on that specific column.
Is there anything i can do to avoid that error?
Thanks in advance.
No offense intended, but I tend to believe the application. There must be an index or a relation that you believe is innocuous but is actually the cause of the error. Therefore, I recommend the following:
In Access, with all tables closed, click the "Database Tools" tab on the ribbon and then click the "Database Documenter" button in the "Analyze" section of the ribbon bar. In the dialog box that appears, place a checkmark beside the table in question and then click the "Options..." button. In the options dialog, make sure that the highest level of detail is selected:
Click "OK" to close the Print Table Definition dialog, then click "OK" again to run the Documenter report.
Study the report carefully. If you don't see the cause of your error then, in the "Data" section of the ribbon, click "PDF or XPS". Save the report as PDF, upload the PDF to a site like wikisend.com, and then post the link here so we can retrieve the report.
Oh, and update your question to tell us exactly how you are trying to insert the data, and in what field(s). If you are using an INSERT query, post the actual SQL code you are trying to use.

VS 2010 Crystal Report

I have a table in ms-sql
obm_FeeTable
FeeId int,
FranchieId int,
Amount Money,
ChequeNo int,
BankName nvarchar(200),
PaymentDate DateTime
when I want to display all collection in crystal report it don't show Amount / PaymentDate
when creating report, don't know why its doing like this.
Please help why is it doing like this. also how to use linq with Crystal Report.
Thanks
To get fields to show up in Crystal's data connection, I often have to go to Database->Set Datasource location and then re-select the same table/view/stored proc I am using. Click the name of your table/view/Stored Proc in both the top and bottom windows. This tells CR to "change" the datasource from the old one (without new fields) to the new one (with new fields) even though they are the same view/table/proc. Then click update. This will reconnect your report with the same datasource, but will pick up any of the changes (new fields) in said datasource.
Yes, you can use LINQ with Crystal, it doesn't matter as long as the data you pull with LINQ ends up as something Crystal can understand. It needs to be stored in a DataSet or DataTable that Crystal can understand (you need to set the reportdatasource to your DS or DT, and it works great.
Have you recently modified the table to add these fields? If so, perhaps Crystal doesn't know about them yet. To fix this, right-click inside the report, select "Database" -> "Log On or Off Server...". OPen The "Current Connections" item and select the one where your table lives. Click the "Log Off" button and then the "Log On" button. This will refresh Crystal's view of the database objects, and you missing fields should appear.
Another possibility is that the login you are using to access the table doesn't have 'select' permission on thos columns.
I don't think linq is applicable to Crystal, but the is a very different question. You should probably post it separately with more detail on what you want to do.

Resources