How To Make DataReports DynaMic like CrystalRepots
Printable View
How To Make DataReports DynaMic like CrystalRepots
Why not just use Crystal, it comes free with VB 5 and 6. You have to search the CD if you're using VB 6
Free Code
I don't know what your specific issue is, but I use Datareporter for dynamic reports and have no issues. I'll admit being a little strange. I went BACK to datareporter after getting frustrated with Crystal, so I'm probably WAY in the minority. If you're having an issue, reply with specifics and we'll see if we can get your problems worked out.
I am going to try to use dataReports. I want the user to specify the criteria for their reports. They will have certain fields ...ie
Report that will show employees of "Company A" that were in "Dept B" with salaries over "Salary Range C".
They will click submit... to query the Access database... then the information will be passed to DataReports. That is what I need from it, so what do you suggest? Thanks for your help in advance!
You need to add a new data environment (deTest) first, then add a new command object and name it 'cmdTest' by right click the connection object, after dialog box popup, you can build your SQL statement, Parameters, Group,, there, use ? for parameter in your criteria such as
once you done with that, you can test the result by right click anywhere, it will ask you to input the value for para then return the result, save the deTest(don't close it -- cause you need it when you try to do your report), add a report - rptTest, arrang the deTest and rptTest side by side so you can drag the fields from deTest to rptTest after you set the properties for rptTestVB Code:
Select * From Cust Where ID = ?
VB Code:
rptTest.datamember -- cmdTest rptTest.datasource -- deTest
save the report.
go the the form where you let user input value of the parameter, in the summit_click event write the code to pass the value to data environment (deTest) and display report.
VB Code:
'Close the recordset first if it is open If deTest.rscmdTest.State = adStateOpen Then deTest.rscmdTest.Close Endif 'Pass the value to Data Environment deTest.cmdTest InputValue 'Display report rptTest.Show
good luck
If getTemp.State = 1 Then getTemp.Close
Set DR1.DataSource = Nothing
getTemp.Open "select t1,t2,t3,t4,t5,t6 from reptemp", cn, 0, 1
Set DR1.DataSource = getTemp
DR1.Show