Can I add a Trendline to an RDLC report? - charts

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 =)

Related

Best approach with Jasper Report

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.

Create crystal report using dataset without using xsd file

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);

Mass Changing Fields in Crystal Reports

I'm currently going through all of our Crystal Reports and changing them to read from Stored Procedures instead of having the joins/tables inside of the report itself.
The problem is, I have to manually remove then add the fields. Is there a way to programmatically or mass change the report fields to avoid wasted man hours? Assuming each field on the report exists by a (slightly) different name in the stored procedure.
Unfortunately there isn't an easy way to do this. You can try going to the database, set datasource location and replacing each table with the stored procedure. Each time you do this you should be prompted to map each field that doesn't have a corresponding entry with the same field name.
Though I think crystal will try to alias the sproc multiple times instead of point all to the same sproc.
I meant to elaborate... When you come to designing more complex reports it's a kind of "best practice" to create formula fields for EVERY field you use in your report. This makes life a lot easier when coming to do something like this in future

How to show data from two different datasources in Activereport

I have a report file . I have to show the data in this report from two different datatable . I have to show the data from one datatable after another . I don't want to use sub report . Is there another way to solve it?
With Regards
The way to solve this with ActiveReports is with a subreport. Other than using subreports, you could use the "unbound mode" to programmatically combine the records from both datatables into a single rowset. See this walkthrough for an example of using unbound mode (see the DataInitialize and FetchData events for the meat of the matter).
It is difficult to say for sure how best to go about this without more information though. For example, some info that might useful:
Are the data tables in the DataSet?
Are the datatables joinable? In other words, is there a relation between them?
Why don't you want to use subreports? This is truly the way a banded report writer like ActiveReports is meant to handle multiple data sources.
Also, you might check out our Data Dynamics Reports product. It uses a different paradigm than banded reports where you lay out data regions (e.g. table, chart, etc.) on a page. Each data region can be bound to a separate data source without using a subreport. Maybe that would be a better fit for what you need.
Scott Willeke
GrapeCity inc.

Use multiple datasource in one crystal report

I am using crystal reports 2008, I want to use multiple data sources in one report. One is connecting informix and another is connecting redbrick data source. Both are independent data source and doesnt have any common value to co -relate them. Can we have that option?
Pleae advice?
Have you tried it already? Crystal Reports allows you to add tables, via Database Expert, from multiple datasources. It will warn you that it may not work, but many times it does.
I had the same problem.
But now its OK after using subreport.
ie. Create the subreport with just the details section and put in inside the main report.
According to my colleague,
For "independent data sources", that have no relationship at all,
we should use subreport.