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!

Is is possibl to create a crytal report from a user selected table?

Status
Not open for further replies.

gere

Programmer
Feb 17, 2004
3
CA
I am using vb5 with CR 4.6. and my CR knowledge is limited. Here is the problem, I need to supply the table name (from which the report is created) from vb. because tables are created by users of the program dynamically. The fields in the tables don't change. Is this possible through some kind of formula or sql query? I tried to read help files, tried ReplaceSelectionFormula, did some sql but couldn't even come close.
 
Not familiar with CR4.5 but could you not pass the query with the user table name aliased as the one used in Crystal.

crpt.SQLQuery = "SELECT * From UserTable CRTable WHERE x =123 " & vbcrlf & "ORDER BY 1,2,3"


Hope this helps
 
Ok sorry for not being so smart, could you please explain what you mean "as the one used in crystal"? I don't have a CRTable do you mean I create one first and then alias...?
 
As a said im not familiar with crystal 4.5 that may be the real issue. In later versions (7,8,9,10) when you create a report in Crystal reports it (the CR designer) will create a sql query and store it in the report based on the tables and fields used. When you run the report via VB you can pass it changes to the query, for example you can be selective in the data by changing the where clause. Maybe this does not apply to v4.5.

Probably no clearer in helping you, if no one else posts here I would suggest trying the Crystal Reports forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top