Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Pass a date range from c# to a formula in CR XI Post Reply Post New Topic
Author Message
elai
Newbie
Newbie


Joined: 09 Apr 2009
Location: Albania
Online Status: Offline
Posts: 1
Quote elai Replybullet Topic: Pass a date range from c# to a formula in CR XI
     Posted: 09 Apr 2009 at 2:07am

hi,

i have created a report in crystal reports, and also a formula called StartingDate in this report like this:

if (isnull({table1.date1}))  then {table1.date2} 
                                 else {table1.date1}

All i want to do is that throw c#, i pass a date range to this formula.

so i have 2 calendars in a form in c#, and the user can pick the date range using the calendars. and the formula then should be sth like
 
cal1.selecteddate < @startingdate < cal2.selecteddate....
 
how can i do this?

can anybody help me??

thank you in advance.



Edited by elai - 09 Apr 2009 at 2:09am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 09 Apr 2009 at 6:16am
Create parameters and then you can the application pass the values from the c# form to the report.  The formula would use the parameter values to calculate what is needed.
 
I don't do it this way, but I am sure that a lot of examples out there.  Some in my office do it this way, and I have posted snippets(they're in VB.NET, but translating is easy).  I use XML files to power Crystal from stored procedures.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum