Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi 7 with Crystal Reports, DYNAMIC COLUMNS!!

Status
Not open for further replies.

shanewiso

Programmer
Jul 20, 2005
5
AU
We are currently trying to make the decision to use either CR9 or Quick Reports, we develop applications with Delphi7.

Anyway, the question I have is, Can CR9 handle Dynamic Columns at Runtime? For Example we have a query that can change the amount of columns in a result set based on the Users Selection, this occurs in the Delphi app.

I dont want to make blank columns in the Crystal Report to handle this, Based on the result set of columns the report should then create the amount of columns needed.

Can anyone assist ?
 
Can't you just "Supress blank section" under Format Section?
Or is this not what you mean?

HTH,

Peter
 
Personally, I use code-based Rave reports. No templates, just code. I can do whatever I want at run time.

Simply drop a TRvSystem component on a form, Call the Execute method, and process the OnPrint event.

Something like this:
Code:
procedure TForm1.pbViewReportClick(Sender: TObject);
begin
  RvSystem.Execute;
end;

procedure TForm1.RvSystemPrint(Sender: TObject);
begin
  PrintReport(TBaseReport(Sender));
end;

procedure TForm1.PrintReport(Report: TBaseReport);
begin
  // Look at the methods available under TBaseReport.
  // Especially the SetTab and PrintTab methods
  // Also see GotoXY, SetFont, and Print
end;
It's also useful to process the OnNewPage event so you can print headings at the appropriate time. (If you have more than one page in a report.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top