PDA

View Full Version : Custom Reports


Kev@Flexi.Net
22-Apr-2004, 03:53 PM
Hi,

I've created a custom report for generating some in-house accounting sheets but I'm having one small problem.

I have all the date selection and everything else working, but I can't seem to get the same codes for generating the From/To text that the in-built reports use.

I'm referring to the @ReportDates Formula field that has the following code:

if {@FromDate} = "" and {@ToDate} = "" then
{@AllDatesText}
else if {@FromDate} = "" then
Left({@ToDateText} + " " + {@ReportToDate}, 255)
else if {@ToDate} = "" then
Left({@FromDateText} + " " + {@ReportFromDate}, 255)
else
Left({@BetweenText} + " " + {@ReportFromDate} + " " + {@AndText} + " " + {@ReportToDate}, 255)

I have added all of the other Formula fields as needed as well so everything works ok.

The problem I am having is with the @ToDate and @FromDate variables. In the supplied reports there is a comment in each of these that says they are set by the application. Does this not happen for custom reports?

Does anyone have an idea on what else I can do to get the ToDate and FromDate information to make the above mentioned formulas work?

Thanks,
Kev

Jan
22-Apr-2004, 05:21 PM
Have you set the report date fields in your reports.ini file?

I can't remember which dates actually get set by the application but I think that it changed between v4/v5/v6. It used to be RDateTo and RDateFrom and I think that it is now either ReportToDate/ReportFromDate or FromDate/ToDate or possibly FromDate/RToDate. To test this rename the formula fields until the application complains about being unable to find a certain formula when the user defined report is run.

Regards,

Eileen
17-Jul-2004, 09:53 AM
Did you ever get this to work?
I am experiencing the same confusion in Actinic V7, trying to use the FromDate and ToDate as in @ReportDates

Jan
17-Jul-2004, 11:26 AM
You have to set up the reports.ini file correctly for your report to get this to work, the reports.ini file lives in your site directory. Here is an example :

[ME_SalesReport]
ReportName=ME_SalesReport.rpt
SelectionFormula=""
ExtraConditions="{Orders.bOrderIsDeleted} = false and {Orders.nPaymentStatus} <> 8 and {Orders.nPaymentStatus}>0"
FromDate="Select &From:"
ToDate="Select &To:"
TestedDate="orders.date order finished"


FromDate and ToDate specify the titles to show in the application and the testedDate field defines the field to use.

Regards,

Eileen
17-Jul-2004, 11:39 AM
Hi Jan,

The dates I enter into the 'Select From' and 'Select To' work for selecting the data to display in the main report, but are not recognised in the subreport or the @ReportDates field.
@FromDate and @ToDate have a comment in them saying they are passed from the application, but are intialised to null.... and do NOT seem to be populated by Actinic.

How can I refer to these fields from inside Crystal Reports?

here is what is in my Reports.ini

[Reports]
ANC_VAT_Report="ANC Vat Charges"

[ANC_VAT_Report]

ReportName=ANCTax.rpt
FromDate="Select &From:"
ToDate="Select &To:"
TestedDate="orders.date ordered"
SelectionFormula=""
ExtraConditions="{Orders.bOrderIsDeleted} = false and {Orders.nPaymentStatus} <> 8 and {Orders.nPaymentStatus}>0"

Jan
19-Jul-2004, 05:37 AM
The answer to your question is here

http://community.actinic.com/showthread.php?t=8220

Regards,