Yogeshup
asked on
Populating different types of charts dynamically
My application stores the chart details like Title, Number of the charts, type of each chart, etc. onto a database table. For example,
Number of Charts : 2
Chart - 1 Title : Efficiency Comparison
Chart - 1 Type : Bar chart
Chart - 2 Title : Sector Allocation
Chart - 1 Type : Pie chart
At the time of report generation, it should be able to identify the type of the chart to draw, and the appropriate chart should be displayed. For example,
Efficiency Comparison Sector Allocation
(Bar Chart) (Pie Chart)
Number of Charts : 2
Chart - 1 Title : Efficiency Comparison
Chart - 1 Type : Bar chart
Chart - 2 Title : Sector Allocation
Chart - 1 Type : Pie chart
At the time of report generation, it should be able to identify the type of the chart to draw, and the appropriate chart should be displayed. For example,
Efficiency Comparison Sector Allocation
(Bar Chart) (Pie Chart)
Are you trying to have crystal create a chart dynamically at runtime? Afaik the object model doesn't support this. You could create a report with different types of charts on it already and then conditionally suppress them at runtime so only the ones you need are visible.
frodoman
frodoman
Use a parameter to pass into the report the choice of which chart should be visible.
Use the parameter in the suppress attribute expression of the chart or of the section within which it is placed to control which chart or section is visible.
Use the parameter in the suppress attribute expression of the chart or of the section within which it is placed to control which chart or section is visible.
ASKER
Hi Frodomam / IdoMillet,
From your comments, i noticed that you have misunderstood my requirement. That is, you have thought based on one particular type of chart, the report will be generated dynamically with that chart type - by passing the chart type as a parameter, suppressing the sub-report. etc.
But, my requirement is, i can have 'N' number of charts in the report created dynamically with appropriate chart-types. Hence, there can be a possibility of 4 pie charts in the same report or all different charts in a report, etc.
Please advise us.
From your comments, i noticed that you have misunderstood my requirement. That is, you have thought based on one particular type of chart, the report will be generated dynamically with that chart type - by passing the chart type as a parameter, suppressing the sub-report. etc.
But, my requirement is, i can have 'N' number of charts in the report created dynamically with appropriate chart-types. Hence, there can be a possibility of 4 pie charts in the same report or all different charts in a report, etc.
Please advise us.
Perhaps I'm still not understanding but let me respond this way:
There isn't a way to dynamically create reports at runtime so if you have a situation where you need 1 to n charts on your report the solution is to create n reports at design time and then at runtime suppress the ones that you don't need.
Another possibility is that you simply create multiple different reports - each formatted the way you need it - and then have your application determine which report should be loaded based on the chart(s) that you need to see. This is probably going to be more efficient than generating a lot of charts that end up being suppressed.
If this answer doesn't help you, can you explain a little more your needs - perhaps give 2 real world examples to help us understand what you're trying to accomplish?
frodoman
There isn't a way to dynamically create reports at runtime so if you have a situation where you need 1 to n charts on your report the solution is to create n reports at design time and then at runtime suppress the ones that you don't need.
Another possibility is that you simply create multiple different reports - each formatted the way you need it - and then have your application determine which report should be loaded based on the chart(s) that you need to see. This is probably going to be more efficient than generating a lot of charts that end up being suppressed.
If this answer doesn't help you, can you explain a little more your needs - perhaps give 2 real world examples to help us understand what you're trying to accomplish?
frodoman
ASKER
Here you are with my exact requirement of the application.
The "Profitability Comparison" of 2 companies is to be shown in Line chart, whereas the "Cost Break-Up" is to be shown in Pie chart, and the "ROE & ROA comparison" is to be shown in Bar chart.
Similar to this, there can be 'N' number of charts which is not defined in the design time (neither the type of charts nor the number of charts nor the order of placement too).
At the querypad page of this report generation only, the user will specify the details of these charts - type, number and order.
Hence, i could not design the all possible scenarios of charts in reports and suppress them at runtime. But hope this should be possible if we create the report itself dynamically at runtime. Please let me know how we can create the RPT file dynamically at runtime using Report Designer / CrystalReportViewer, etc.?
The "Profitability Comparison" of 2 companies is to be shown in Line chart, whereas the "Cost Break-Up" is to be shown in Pie chart, and the "ROE & ROA comparison" is to be shown in Bar chart.
Similar to this, there can be 'N' number of charts which is not defined in the design time (neither the type of charts nor the number of charts nor the order of placement too).
At the querypad page of this report generation only, the user will specify the details of these charts - type, number and order.
Hence, i could not design the all possible scenarios of charts in reports and suppress them at runtime. But hope this should be possible if we create the report itself dynamically at runtime. Please let me know how we can create the RPT file dynamically at runtime using Report Designer / CrystalReportViewer, etc.?
Crystal doesn't lend itself well to allowing the user to specify the requirements at that point.
What version of Crystal do you have? If it is the version that comes with Visual Studio you may not be able to do it. This will require runtime licenses for Crystal for all users and may even require all users to have Crystal installed.
mlmcc
What version of Crystal do you have? If it is the version that comes with Visual Studio you may not be able to do it. This will require runtime licenses for Crystal for all users and may even require all users to have Crystal installed.
mlmcc
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
DropDownList1.DataSource = [connectionstring]
DropDownList1.DataTextFiel
DropDownList1.DataValueFie
DropDownList1.DataBind()
Then based on TYPE [in DataValueField], you can display different charts.