Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts

Wednesday, March 7, 2012

Recordset in Crystal Report 8

Hello,
The problem:

I have a report performed with the crystal assist.The report is label style and the crystal Reports creates a image of the label for every row in the recordset.The problem occurs when i pass the recordset from the VB 6.

Before printing I create the crystalreport object, the crystalreport datababase object and the crystalreporttable object pointing to the ttx file.But when I execute the CrystalReport preview method, the report dont shows any data.

Here is a sample of teh code:

Set report = app.OpenReport(Path & FicheroRPT)
Set reportDb = report.Database
Set reportTables = reportDb.Tables
Set reportTable = reportTables.Item(1)
Call reportTable.SetPrivateData(3, Data)

Call report.preview

The Report has many detail sections ( from "a" to "v").Could this be the problem.

If anyone can help me...Open the Report and Do Verify Database
Uncheck the option "Saved Data"

RecordSelectionFormula not appearing in the Query

I am using Crystal Reports 7 with VB6.
I am sending some user defined parameters from the application to filter the records and its getting set to the CRPEAuto.Report.RecordSelectionFormula, along with a hardcoded condition in the Report-Edit Selection Formula at design time. The design time and runtime parameter values are getting concatenated properly with the required relational operator.

1.
But the method CRPEAuto.Report.SQLQueryString, retrieves the query of the report(Show SQL Query), without the condition set in the RecordSelectionFormula above.

2.
The query returned above, when executed in the SQL Navigator, runs in 6mins and records are fetched. But the report preview from the application which displays the records on Crystal Report runs indefinetly and no output is got.

Any inputs on this would be appreciated.
Many Thanks.You can use stored procedure with input parameters
Did the query returned is valid?

Saturday, February 25, 2012

RecordNumber field Q...

Greetz. . My problem is: I'm kinda unfamiliar with both Crystal Reports and VBasic as well .. and yet, my job position requires me to do the following:

I have a report which draws it's data from an SQL Database .. Depending on the data in the database ( table ), the report may have as little as 1 or as many as 30 or more records generated on it. Now, what I need you guys 2 help me with is .. When the special field RecordNumber reaches a certain value ( 20 for example ), I should somehow ( that's where you jump in ) tell the report to pass the remaining data onto the next page.

Now, I've tried 2 do something like If fldrecno.value > 20 then report.newpage ( where fldrecno is a name of the recordnumber field ) but I keep getting the same message Runtime Error 424, Object Required. As I said, I'm a newbie in both CReports and VBasic (6.0) area .. and any help would be more than appritiated.
If the problem cannot be solved using the recordnumber field, maybe a formula might help. Again .. I don't know much about formulas either.In the Crystal report's Design window,right click the left panel of "Details" ,in
Format section --> New page after -->Formula Editor(X+2 button) , write this code and try

RecordNumber>=(PageNumber*20)
I think you can pass a variable instead of 20...:)|||In the Crystal report's Design window,right click the left panel of "Details" ,in
Format section --> New page after -->Formula Editor(X+2 button) , write this code and try

RecordNumber>=(PageNumber*20)
I think you can pass a variable instead of 20...:)

Otherwise write this code

RecordNumber mod 20=0|||Thnx a bunch! It works .. and it works fine ..

Monday, February 20, 2012

Record value depending of the next record

Hi,
I am trying to do something with Crystal Reports 9, but I am not sure if it is possible to do it...

how_long is the field I want to add
...depending of how many consecutive True value there is in the active field, I want to know for how many days it is True

when it is False...I put no value in the how_long record

SEE example.txt

I thought I could use the function Next(), but I need to go further than the next record

Any way to do this?
Would it be with a subreport? I don't know
Thanks for your help

Michaelput a formula which gives 1 when active is true then use running total and reset it when value changes , hope it workss..

Record Selection Formula. Impossible?

I have a problem selecting records in my crystal report. There are two string parameters, dateFrom and dateTo. The record selection formula is:

{payroll_history.dateModified} in CDate({?dateFrom}) to CDate({?dateTo})

When typing in the string parameters in crystal, the report works fine, suggesting the fault is in the parsing from vb to crystal. See code below:

Report.Parameters.getItemByName("dateFrom").setCurrentValue(strDateFrom)
Report.Parameters.getItemByName("dateFrom").setCurrentValue(strDateFrom)

HOWEVER, I can display these parameters on the screen perfectly fine when executing the report from VB. Surely this means the selection formula is incorrect?? But it works from within crystal! Argh!

Any help anyone can give me will be so much appreciated.My first thought is that you have a DateTime field, but are trying to use a string parameter. Is payroll_history.dateModified a DateTime field in the database? If so, you need to pass it a DateTime. Also, if it is DateTime and not just Date, you will need to add the hour which, if you don't use a time, will have to be 00:00:00, so the parameter passed would have to be something like 08/12/2006 00:00:00 or else it won't work.

Record Selection Crystal Reports

I'm trying to get Crystal reports to prompt the user each time they run the report for the company they want to run the report an the date range they want to run the report on. Unfortunatly I can only get it to do the company at run time. In order to filter out the date range and the company I have to use the selection expert which dosent really help my users is there anyway to filter both sets of values when running the report live for the customer?Cant you pass these values thru the Application you are using?