Link to home
Start Free TrialLog in
Avatar of ocortes
ocortes

asked on

How to dynamically change line chart in Crystal Reports for .net 2003

Hello,
I have a Crystal Report that contains a line chart. It works good but I want to be able to dynamically change the Data, for example I want to chage the option "On Change of" that at this moment is date for a differente field. Also I want to be able to change the "Show value(s)" summary operation from sum to avg from my asp.net page using C#. I wan to know if this is possible passing parameters and some kind of formulas but I haven't found anything on the Internet so far. Any help will be appreciate it.
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

I would recommend coding your data in a stored procedure using parameters

In your ASP . . . any time there is a change to the params, recall the stored proc and the data will update automatically.

Sum to Avg is just another parameter.

Say you pass a 0 for sum
make a conditional supress formula in crystal for the sum RT when that value <> 0
do the same for Avg where the value <> 1 .  . . you can overlay them in the same position, but you'll only ever show the one of them.
Avatar of ocortes
ocortes

ASKER

Hi,
Actually the report is generated by a stored procedure with the parameters, customer, date1 and date2 the report just shows loads of product picked up with their test result in the range of dates so we have the following columns:
Date
Ticket
Lbs
Test1
Test2
I am just creating a line chart showing each load using "in the change of" Ticket and the max "summary operation". This gives me a point in the chart for every load. But if the customer has to many loads the chart gets too many points that it is impossible to read, so I want to group by date and set "in the change of" Date and show the average as "summary function". I can pass parameters to the report without problems but then I don't know how create the formulas to manipulate the chart or what fiields to change. Could you help me with that?
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocortes

ASKER

Thank you very much for both options. Right now the report is on the Report Header but I can move it and I also like the idea of two charts in two sections.  I will try them and let you know.
Regards
Remember you can click on the report header and 'insert section below' to get two report header sections.

The only place it doesn't work to do this is page footer. (Page, not report)
It works in CR XI to get multiple Page Footers.  You click in the left margin not the section itself.

mlmcc
Yes, but the space is always reserved for (either all, or the largest) page footer section,
so doing this where one or the other is always 'off' can wind up getting you large areas of blank space.
Avatar of ocortes

ASKER

Thank you very much, I went with the idea of two charts in two sections but I test the other idea and seams to work to.
Best Regards