The server uses Crystal Reports Embedded Server 2008 SP3 (running on Windows Server 2008 R2 / IIS 7.5), and I am using Crystal Reports Developer 2008 SP3 on my PC.
Hello,
I am a MSSQL database administrator with little experience with Crystal Reports. At my job, we have a need to add a couple of fields to a report. The report comes with an enterprise procurement web-based application and displays the details of a given purchase order. They want me to add the supplier’s address below the supplier’s name on the report. I was hoping there might be a fairly straight-forward, not overly complicated answer to my question.
The report works with a stored procedure (OrderForm1) which creates a temp table called #ReportParameters. It then executes another stored procedure (GetReportParameters), in which it uses 'sp_xml_preparedocument' and eventually 'sp_xml_removedocument'. It then executes a stored procedure called (OrderForm1Main) which contains the select statement that brings in the bulk of the fields and joining the pertinent tables. I made a backup copy of OrderForm1Main and modified the original, to include the supplier address fields.
Don't know if I'm on the right track, but here’s what I tried so far:
When I open the OrderForm1.rpt in Crystal Designer, I have found that I can go to Database > Set Datasource Location, create a connection (OLE DB (ADO)) to the database, highlight the name of the stored procedure under ‘Current Data Source’, then find the same stored procedure in the database in the section ‘Replace with’:
http://i.imgur.com/KXBuf.png - http://i.imgur.com/KXBuf.png
When I clicked the ‘Update’ button, a ‘Enter Values’ for parameters window pops up:
http://i.imgur.com/5uQ9V.png - http://i.imgur.com/5uQ9V.png
I’m confused as to what to do at this part. Whether I click ‘OK’ or ‘Cancel’, it then adds my database connection with stored procedure to the list in the ‘Current Data Source’ section:
http://i.imgur.com/aD4KH.png - http://i.imgur.com/aD4KH.png
After completing this data source change, in the Field Explorer under Database Fields > OrderForm1, it then includes the new fields I added to the stored procedure. However, when dragging the new supplier address fields to the report layout, saving the report in this state, and trying to run it in the web application, the report window displays the message ‘Missing parameter values’ instead of the report:
http://i.imgur.com/gz8S3.png - http://i.imgur.com/gz8S3.png
In Field Explorer > Database Fields > Parameters, I’m seeing a list of parameters that aren’t the exact ones in the stored procedure, which leads me to believe, they are somehow defined in the report itself. Also, under ‘Parameter Fields’ in the Fields Explorer there is the @fParameters listing with a question mark icon, that appeared since the data source change:
http://i.imgur.com/llkrk.png - http://i.imgur.com/llkrk.png
There does not seem to be an equivalent set of parameters in the database, as there were defined in the report. I imagine that the actual parameter values come from the data held in the currently displayed purchase order (from which you can push a button 'Print PO' that will display the report in question). I have read that when you change a data source in Crystal, you have to complete the task of resetting, or adding back in the parameters. That would be easy if they were in the database somewhere. Whenever I attempt to look at the properties of the ‘ReportInformation’ in ‘Set Datasource Location’, or simply try Database > 'Verify Database' to refresh the datasource, an ‘ADO.NET (XML) windows pops up with a file path in it, something to the effect of: file://myloanerlaptop/ebo%20bk/orderform1.xml - \\MyLoanerLaptop\ebo bk\orderform1.xml :
http://i.imgur.com/SEVOE.png - http://i.imgur.com/SEVOE.png
I did a search on the entire server for the file OrderForm1.XML and could not find it anywhere. So I’m thinking that the software company’s development team used that file originally, to create the report (did they use a dataset to do this, or is the temporary XML file created during the process actually the schema here?). I think I’m basically trying to change the data source in the report, to an updated version of the original stored procedure referenced, while still somehow leaving the parameters list in the report alone and have them still work?
Any and all help would be greatly appreciated. I realize that this type of work most likely is routine stuff that can be learned by taking the time to do so. My team is only interested in allowing me a certain amount of time and resources to delve into Crystal and we do not have a Crystal dev team. So, hopefully you understand my dilemma here.
Thank you,
Mike
|