I would like to ask if it is possible to create a crystal report using a dataset without using or creating an xsd file. Because there's one report here that does that. It is connected to a dataset but there's no xsd file that is used.
Of course you can, just use the report document's SetDataSource method :
YourReportDocument.SetDataSource(YourDS);
Related
I am stepping into a new reporting environment and I don't have a lot of background info yet. But my company utilizes a series of crystal reports.
I want to compare two reports that are identical except that they connect to different data sources. I can click on both reports in the Crystal Reports viewer, go to Database > Set Database Location and I am able to see the data source. If I do this for both reports in question, I can see that they both connect to different data sources, as expected.
However, when I export the two Crystal Reports as text files and then compare them using Notepad++, I don't see the datasource / connection string in the report files, so when I do a compare, they are exactly the same.
If the exported text files are exactly the same, how does Crystal Reports Viewer know to point one report towards a prod data source and another report towards the dev data source? It does not appear to be embedded in the exported metadata / report definition file.
Thank you!!
The connection info is simply not part of the exported report definition text.
But, obviously, it is part of the report definition.
If you need to export more detailed report definition information, including connection properties, consider getting a documentation utility. Ken Hamady maintains a list of those here.
I have a requirement to generate reports in PDF and Excel format. For the same I have chosen Jasper. Now require some help from your side to identify the best approach on the same.
Note - My queries are dynamic in nature.Like in some scenario then will provide name in some scenario they will provide dates not name and in some scenario both.
Approaches I have identified are given below.
We can create data source and query in JRXML and execute the same.But not sure query will be dynamic or not. I am personally not prefer this approach because from java I can pass the connection from pool.
We can pass the query and connection both from the Java side and then Japser will execute the query.
We can query in java and then pass the List of bean to the Jasper for report creation.
Now need some suggestions on the best approach among above and also of any approach suggested apart from the above.
To me, option 3 is best. I did that previously.
For mine, I had a master report containing conditional sub-reports. To do that, I have build sub-report's .jasper from their .jrxml and passed my List of bean so that I don't have to re/compile the .jasper from .jrxml again(My master report was in .jrxml and condition for sub-reports where set there).
Another advantage is, you don't have to change your jasper files if you want to change your logic in query level-just leave them untouched once done.
So, I think , option 3 is good to go.
I am developing a report in Crystal Reports 2013 to publish to a Business Objects server. The user wants it to be able to run to HTML, PDF, Excel, or CSV. If I make it compatible with CSV (a raw data dump with one row per record -- for use downstream by a machine) it will be too wide to fit on one page for the PDF output. We have no direct control of the Business Objects server. This is all done through the cloud application.
...and I'm new to Crystal Reports...
Is there a way to create two sections in the report -- one for CSV and one for PDF -- and have one render (or hide) when the report is run to Excel or CSV and the other render (or hide) when the report is run to HTML or PDF? How?
No, but you can create a parameter that prompts the user for desired layout ("For PDF", "For CSV") and use that parameter in the dynamic expression for section suppress attribute.
Assuming they don't, you can always go to plan B and simply create 2 different reports.
Adding a subreport into a report with Java and Jasper Reports was easy enough, but I am having trouble making that subreport into something loopable.
The code in Java was simple enough: create report and loop through the parameters to generate subreports. The report generated at the end is a XLS file.
The hassle starts with Jasper Reports since the second iteration complains about the subreport datasource ID already being in use, but then if I generate dynamically the names in the Java code, the Jasper Report won't compile since the subreport's database name is fixed in the XML.
I could, in theory, just create several of the reports with a single subreport and then attach all of them together, but that doesn't feel optimal. How can I create the looped reports then? Is it some sort of parameter to be given in the XML from Jasper Reports or is it impossible to be done and I must use the multiple reports strategy instead?
I have an RDLC report based on custom Data sets used in a WPF application.
I have a Chart with a simple line chart.
IS there a way I can add a trendline to this RDLC report?
I had this problem recently, and just solved it this very minute.
My solution (might not be the best) was to use a stored procedure from the same database as the data to add 'trend' data to the columns returned.
To do the same, you'd need some knowledge of linear regressions, etc. Which I got from stackoverflow here
Are you using a database driven dataset or a static dataset, such as XML?
If you're using SQL Server, I can paste the function I used and you can take from it what you like =)