473,325 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Data Reports

Ali Rizwan
925 512MB
Hi all,

How can i add or delete some columns from datareport at runtime.
How can i refresh datareport at runtime.

How can i format fields at runtime
How can i cjange the datastring or database at runtime.

Using XP
Using VB6
Using Data Environment
Using Data Report not Crystal Reports.

Thanx
Nov 2 '07 #1
8 1749
Dököll
2,364 Expert 2GB
Hi all,

How can i add or delete some columns from datareport at runtime.
How can i refresh datareport at runtime.

How can i format fields at runtime
How can i cjange the datastring or database at runtime.

Using XP
Using VB6
Using Data Environment
Using Data Report not Crystal Reports.

Thanx
Let's try it one at a time, if you do not mind, Ali...

I think this will handle refreshing the data:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form_Load()
  3.     Set conn = New ADODB.Connection
  4.     conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  5.         "Data Source=" & App.Path & "\YourDB.mdb;" & _
  6.         "Persist Security Info=False"
  7. End Sub
  8.  
  9. Private Sub cmdLoad_Click()
  10.     Set rs = conn.Execute("SELECT Field1, Field2, Field3 " & _
  11.         "Field4 FROM ThisTable ORDER BY Field1")
  12.  
  13.     Set rptTitles.DataSource = rs
  14.     rptTitles.Show vbModal
  15. End Sub
  16.  
  17. Private Sub Form_Unload(Cancel As Integer)
  18.     conn.Close
  19. End Sub
  20.  
  21.  
Tell us how that works then we'll tackle the rest. How's that for a deal?

Dököll
Nov 3 '07 #2
Ali Rizwan
925 512MB
Thanks for the reply dokol.
But as i mention i am using dataenvironment for this purpose.
I don't want to make a connection programatically.
I just want to refresh the dataenvironment.
How can i do it.
Nov 3 '07 #3
Ali Rizwan
925 512MB
Some more questions please..
How can i mke new controls in a datareport.
Thanx
Nov 3 '07 #4
Ali Rizwan
925 512MB
How can i make a datareport progrmaticaly.
Thanx
Nov 3 '07 #5
debasisdas
8,127 Expert 4TB
Both the threads are merged for better management of the forum.
Nov 3 '07 #6
9815402440
180 100+
HI

as far as my knowledge is we cannot delete control from datareport but can set their visibliltity to false. but for this type of problams i apply following logic.

draw 13 (or any number ) lables for headings and 13 Text boxes in the datareport.

set their visible property to false.

name labels as Label0, label1, label2.... and so on
similarlay name textboxes as Text0,Text1,Text2 and so on

Query to make recordset must look as :

select strStudentName as [Student Name],strFatherName as [Father Name] from Table

write following loop to bind these controls

for i = 0 to rst.fields.count-1

dataReport.sections("PH").controls("Label" & i).caption = rst.fields(i).name
dataReport.sections("PH").controls("Label" & i).visible = true

dataReport.sections("Detail").controls("Text" & i).datamember = ""
dataReport.sections("Detail").controls("Text" & i).datafield = rst.fields(i).name
dataReport.sections("Detail").controls("Text" & i).visible = true
next

dim ii
for ii = i to 13 '(Max no of controls in the data report)
dataReport.sections("Detail").controls("Text" & ii).datamember = ""
dataReport.sections("Detail").controls("Text" & ii).datafield = rst.fields(0).name
dataReport.sections("Detail").controls("Text" & ii).visible = false
next

This way you can show or hide controls at run time
i have directly typed the code in this window. so possibilit of errors exists. These lines are just to suggest the logic

regards
manpreet singh dhillon hoshiarpur
Nov 3 '07 #7
Ali Rizwan
925 512MB
Thanks a lot.
I ll try it and tell you how it works.
Nov 3 '07 #8
Thanks a lot.
I ll try it and tell you how it works.
>>>>>hii nice snippet...workin well
Aug 18 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Alex | last post by:
Hi all, I've seen this noted in many posts, but nothing I've checked out gives me any clue on how to do this. Basically as my topic says, I have a DTS and I simply need to export some data...
7
by: Paolo | last post by:
I know I should not be doing this, but I find it very useful. I have a database in Access which stores data for a small company. Sometimes we need to add similar information to different tables....
1
by: Queen's | last post by:
I have a database I'm working with which has tables and reports. The controls in the reports are bound to data, but I'm at a loss to explain where the data is coming from. I have gone so far as to...
1
by: Sara Montgomery | last post by:
I have a database I'm working with which has tables and reports. The controls in the reports are bound to data, but I'm at a loss to explain where the data is coming from. I have gone so far as to...
1
by: warlord | last post by:
In order to save typing, I've borrowed the text from a post of nearly 12 months ago.....but the problem still exists. I've been banging my head all day with this, so I'm hoping someone has some...
2
by: Priyavenkat | last post by:
i am using VB 6.0, MS Access as backend and Crystal Reports 10 for reports. I connect data source to Crystal Reports 10 using ODBC dsn. It works correctly in my PC. When it is distributed to another...
5
by: ElTipo | last post by:
Hello People, I made a data base with secure wizard to provide to users a PID and Passwords. I need to extract data from Crystal Reports 7 in this data base but Crystal Reports send me a message...
1
by: babbles | last post by:
I have a problem about data reports. My project is to view reports monthly, yearly and daily and show the query on MShflexgrid and show the total income summary. I have already made my query on that...
10
by: giraffeboy | last post by:
Hi there, I'm having a problem with the Python db api, using MySQL. I've written a program with a GUI using wxPython, the GUI is contained in main.py which imports another module - reports.py....
6
by: Peter | last post by:
I have a WebService which returns a List of RunningReport class How do I read this XML data on the client side. How do I convert List<RunningReportfrom the WebService side to List<RunningReporton...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.