hi
i have my database that show by crystal report, it has field ID and Name.
i need that if the value of ID = 8 the line in crystal report will paint in red
and if ID=10 in green.
i use C# VS2008
thank's in advance
hi
i have my database that show by crystal report, it has field ID and Name.
i need that if the value of ID = 8 the line in crystal report will paint in red
and if ID=10 in green.
i use C# VS2008
thank's in advance
Use formula for that line in your report. its so simple... you can write ur code as VB...
Ok... You forced me to install a windows XP in a virtual machine and VS 2008 on it to find this answer... ;)
anyway, this is the answer...
You should write this code where ever u wanna show that report:
First of all add this refrence to your code:
using CrystalDecisions.CrystalReports.Engine;
Then you can access your object (in our case its a LineObject
) like so:
ReportDocument reportDoc = CrystalReport11;
//1- define a LineObject variable
LineObject myLine;
//Find the object in ReportObjects collection and cast it as LineObject
//and finally, set it to your variable
myLine = ((LineObject)reportDoc.ReportDefinition.ReportObjects["Line1"]);
//do your changes...
myLine.LineColor = Color.Red;
I've defined a ReportDocument
in order to show you how to do it with dynamically loaded reports...
Good luck