Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

Creating a 2 column report

Any suggestions on how to create a report that has 2 columns?


Here is what I am after, a 1 page report that has 100 records of information shown in 2 colums of 50 records each. There is some header/footer information on the
page as well. It would look something like this...


#####HEADERDATA######

###COL1###  ###COL2###
###COL1###  ###COL2###
###COL1###  ###COL2###
###COL1###  ###COL2###
###COL1###  ###COL2###
###COL1###  ###COL2###
###COL1###  ###COL2###
###COL1###  ###COL2###
###COL1###  ###COL2###
###COL1###  ###COL2###

#####FOOTERDATA######




The question is, what tool do I use to get VB to do this? The only thing I can think of off hand is to simply use the printer object and built the report the hard way. But if there is a way to use Crystal Reports (the version that comes free with VB6) or the DataReport object, please let me know and I will do it that way instead.


This was an MS Access project and Access has a really great report engine. VB6 seems to be really lacking in that department.
0
gwiz
Asked:
gwiz
  • 4
  • 3
  • 2
  • +3
1 Solution
 
Anthony PerkinsCommented:
Is the data in Access or is it a text file?  Either Crystal or the Data Report should be able to handle it.

Anthony
0
 
Ryan ChongCommented:
>But if there is a way to use Crystal Reports (the version that comes free with VB6) ..

If not wrong, the Free Crystal Report comes with VB5 but not VB6

and as Anthony stated, you can use Data Report (which included in VB6) or Crystal Report (separate application) to develop the reports.

regards
0
 
gwizAuthor Commented:
Crystal reports does come with VB6. You just have to find it on the CD and install it manually. I was a bit upset when installing VB6 and not finding it. Then tech support helped me locate it on the CD.

The data is currently in a non-database recordset. An ado recordset that has no physical file (all in memory) but the data is actually stored in XML files.

If needed, I can put the file on the hard drive in JET or Textfile format. If this can be delt with using the DataReport object, that would be best because it can accept the ADO recordset from memory as the datasource. This I have done before. Just never done a multi-column report.

Can you explain step by step how to set up the report to be multi column? Don't worry about the details of connecting to the datasource as I know that part. Just the steps of creating multi column reports is what I am lacking.

An example walk though using the DataReport would be best but an example of each would be much appreciated (and increase the points to 300)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Éric MoreauSenior .Net ConsultantCommented:
The Datareport engine cannot create real 2 columns reports. You need to create a dummy table with 2 fields (column1 and Column2) and bind your recordset to this dummy table.
0
 
Anthony PerkinsCommented:
gwiz,

emoreau is absolutely correct.  I misunderstood your original question.

Anthony
0
 
jayeshshahCommented:
Well you can made the same report in MS-Access & then using the Access object you can open the report. The report becomes visible and you can view it the same way you view it in Ms-Access
0
 
Éric MoreauSenior .Net ConsultantCommented:
Very good idea jayeshshah . I just want to warn you that all users need to have Access installed to use this solution.

Here is the code that you need to display an Access report from VB:

Const dbPathName = "c:\database.mdb"
Const strPassword = "PASSWORD"
Dim Acc As Object, db As Object

Set Acc = CreateObject("Access.Application")
Set db = Acc.Application.DBEngine.Workspaces(0).OpenDatabase(dbPathName, 0, False, ";pwd=" & strPassword)
Acc.OpenCurrentDatabase dbPathName, False
Set db = Nothing
Acc.DoCmd.OpenReport "ReportName", acPreview
Set Acc = Nothing
0
 
schworakCommented:
Most people won't have access which is one reason for removing it from that platform.

I think I will try the suggestion from emoreau first.

Anyone know if Crystal can do true 2 column reports?



Thinking about it now, the fake 2 column method might actually add extra benifits in this case so I may stick with it. But it would be nice to know if Crystal can do it.



emoreau, do you know if it is posible to SHOW/HIDE objects as the report is being built? I ask because I am finding that I may need to hide a field if a special value is in it.
0
 
jayeshshahCommented:
Dear emoreau,
Definately, i think that users are not dumb enough that they donot even have MSOffice installed on their machine.
0
 
gwizAuthor Commented:
Sorry about that last post. I didn't realize my room mate was still logged in on my compuert
0
 
gwizAuthor Commented:
Sorry about that last post. I didn't realize my room mate was still logged in on my compuert
0
 
Éric MoreauSenior .Net ConsultantCommented:
>>Anyone know if Crystal can do true 2 column reports?

Yes


>>Definately, i think that users are not dumb enough that they donot even have MSOffice installed on their machine.

We are not talking about Office, we are talking about Access. Access is not installed with all version of Office (I think they call the Pro version the one that includes Access). Some programmers are not aware of this.


>>do you know if it is posible to SHOW/HIDE objects as the report is being built

I have seen it once (but I can't remember where). Another option is to create a MDB which will only contain reports and you can link it to the database that contain data.
0
 
gwizAuthor Commented:
The Access idea is a good one but not for this project. I will try the DataReport object and see how that goes. Thanks all. I will get back to you soon.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now