PDA

Click to See Complete Forum and Search --> : reporting help


athaneum
Feb 22nd, 2006, 11:03 PM
i am making this inventory program where the user can query the database...for example he can find out what items are used for this particular project for a given date span or who used those items..etc..he can even make his own sql...
but on the datareports and crystal reports i think you have to like make a template first of the report...that you have to specify the fields to be shown...but the user is given the flexibility on his queries so the fields may vary for each query...how do i make a report for that?
don't know if it makes sense but i want to have a sort of a dynamic report..where fields on the report would depend on the query of the user..
thanks

saldiboy
Feb 22nd, 2006, 11:30 PM
hi,

you can make a query or views joining all the tables that you need and link it to your report.

in your vb code if you use a crystal report viewer control, you can manipulate the SQLQuery property depending on what you need..

for ex.:
if you want to display a particular product then your sqlstatement should be
cr.SQLQuery="SELECT * FROM yourView WHERE ProductName='" & txtProduct & "'"

and so on and so forth...

i just gave you one idea but there are several ways in solving your problem..


best regards,

saldiboy

athaneum
Feb 22nd, 2006, 11:58 PM
tnx but would the layout of the report be ok? i mean..no overlapping of fields..etc? and what if i dont use cr? just asking...but i have Crystal reports 10...thanks for the reply...

saldiboy
Feb 23rd, 2006, 12:21 AM
cr is the name of the crystal report control...
you can design your report on your own way, selecting your needed fields.. etc.
and save it as a rpt file.
then you can call it thru your vb code by using the crystal report control..
i haven't use crystal report 10 but i think the same principle will apply.



best regards,

saldiboy

athaneum
Feb 23rd, 2006, 12:25 AM
the problem i have is what if the user just needed one field or lets say i designed the report with only 5 fields and the user's query is for 7 fields...now how do i solve that one?
and yeah...i know what cr means..but what i meant is are there any other way aside from crystal reports? just to keep my options open

Hack
Feb 23rd, 2006, 05:41 AM
Crystal Reports is just one of several options.

You can design and run Access reports from VB. There are other third party report generators as well, like Report Writer.

You might want to take a look at these (http://www.google.com/search?hl=en&q=reporting+vb6&btnG=Google+Search) links that were returned by Google when I searched the subject of reporting.

What are you using for a front end by the way?

VB6?
VB.NET?
C#?

athaneum
Feb 23rd, 2006, 05:55 AM
is there any other way where i dont have to purchase anything? just a code hack will do as long as its working...thanks

athaneum
Feb 23rd, 2006, 06:28 AM
and where can i see the cr viewer control? all i can see is cr activex viewer library 10.0 and there's no .sqlquery like saldiboy said..

athaneum
Feb 23rd, 2006, 07:13 AM
i think that crystal reports need to have bound fields to make a report...
what other report can i use so i just pass a sql query and the report will automatically add the fields necessary?

athaneum
Feb 23rd, 2006, 07:14 AM
its vb6...

athaneum
Feb 24th, 2006, 06:56 AM
hi hack..i was wondering if i make a php script where it will accept the sql query from vb...and open the php script on web browser control...and the script will then make a table based on the query..but is there a way where i can wrap the table? coz when the table is wide enough like the table's width is 800..then only about 650 are printed...the rest are not...what do i make of it? anyway to fit the table on the paper or wrap it?