473,587 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Slabwise & Pagewise Datareport

41 New Member
Hi all.
In my project I am using VB6.0 & Access 2003. I want to create Slab wise & Pagewise Datareport as shown below.

Marks <30

ID Subject Marks
11 Maths 25
75 Science 18

<page Break>

Marks >30 and < 40 ' on next page
ID Subject Marks
65 Maths 38
34 Science 33
81 English 37
34 Science 35

<page break>

and so on for slabs 40 to 50, 50 to 60, 60 to 70....

Please give me hint or sample code if possibe. Give code for DataReport as I dont have Crystal Report.
Thanks
Nov 29 '07 #1
6 1783
Dököll
2,364 Recognized Expert Top Contributor
Hi all.
In my project I am using VB6.0 & Access 2003. I want to create Slab wise & Pagewise Datareport as shown below.

Marks <30

ID Subject Marks
11 Maths 25
75 Science 18

<page Break>

Marks >30 and < 40 ' on next page
ID Subject Marks
65 Maths 38
34 Science 33
81 English 37
34 Science 35

<page break>

and so on for slabs 40 to 50, 50 to 60, 60 to 70....

Please give me hint or sample code if possibe. Give code for DataReport as I dont have Crystal Report.
Thanks
I searched but could not find anything on this for you. Do stay tuned nonetheless in case other experts have an idea.

The Data reports I am used to aren't that fancy (Data Environ,DataRep ort), so no joy there;-)

Have a great week-end!

Dököll
Nov 30 '07 #2
Neelesh2007
41 New Member
Thanx Dököll,
But i can not enjoy my weekend without solution of this problem. Can anybody else help me?

Thanks.
Dec 2 '07 #3
9815402440
180 New Member
hi
use following code for the purspose

Dim rst As New ADODB.Recordset
'MakeRecordSet is a function that i use to opens recordset. if you need its code, please ask me.
Set rst = MakeRecordSet(" shape {select * from Table1} as rsAlias append new adbstr key")
With rst
.MoveFirst
While Not .EOF
' all slabs that falls in 0 - 30, value of "Key" is "0-30"
' all slabs that falls in 30-40, value of "Key" is "30-40"
' and so on
' so check for slabs and give value to "Key" accordingly


if fallsin("0-30") then
.Fields("Key"). Value = "0-30"
else
.Fields("Key"). Value = ""
endif
.MoveNext
Wend
End With
Dim strGrp As String
strGrp = "AS GroupedData COMPUTE GroupedData,Cou nt(GroupedData. 'Fld1') AS CountOfFld1 BY 'fld1'"
Dim rstGrouped As New ADODB.Recordset
rstGrouped.Open "Shape rsAlias " & strGrp, cn '(cn is connection)
'bind and show report as follows

With DataReport1
Set .DataSource = rstGrouped
.DataMember = ""
With .Sections("Grou pHeader").Contr ols
.Item("key").Da taMember = ""
.Item("key").Da taField = "key"
End With
With .Sections("Deta il").Controls
.Item("fld1").D ataMember = "GroupedDat a"
.Item("flde").D ataField = "fld1"

.Item("fld2").D ataMember = "GroupedDat a"
.Item("fld2").D ataField = "fld2"
End With
.Refresh
.Show
End With

this code is just to suggest logic or usage. please check for errors.

regards
manpreet singh dhillon hoshiarpur
Dec 3 '07 #4
Neelesh2007
41 New Member
Thanks lot for your code. But ya i require code for function maketable. Also i am not familiar with keyword 'shape'. Will it work with Access?.
Thanks again for your help.

Neelesh.
Dec 3 '07 #5
9815402440
180 New Member
hi

following is the code for MakeRecordset function


Private Function MakeRecordset(q ry As String) As ADODB.Recordset
Dim cn As New ADODB.Connectio n
With cn
.Provider = "MsDataShap e"
.Properties("Da ta Provider") = "Microsoft.Jet. OLEDB.4.0"
.Properties("Da ta Source") = App.Path & "\data.mdb"
.Open
End With

Dim rst As New ADODB.Recordset
rst.Open qry, cn
Set MakeRecordset = rst
Set rst = Nothing
End Function

Shape clause works with ms access also.
regards
manpreet singh dhillon hoshiarpur
Dec 6 '07 #6
Neelesh2007
41 New Member
Thanks a lot Manpreet.


Neelesh
Dec 8 '07 #7

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

Similar topics

2
4697
by: berthelot samuel | last post by:
Hi everyone, I am currently trying to write a report based on a View of SQL Server. Basically, I have 3 tables : Hardware, SoftwareInstalled and Software with SoftwareInstalled that keeps track of all the software installed on each piece of hardware by referencing the primary keys of each table. So now, I have a request that retrieve...
1
4370
by: Speed | last post by:
How to write informations from database in Page Header section like in Detal section of DataReport?
1
2306
by: Gary | last post by:
Dear Is it possible using ASP to call VB6 DataReport? if yes any reference of creating those com+ of DataReport and Call method? Gary
5
3322
by: anoopgopal007 | last post by:
Hi, I am using vb6 and datareport. I am updating the tables whle the program running. But the datareport doesnot show the updated information. Its always shows the previous value. But when i restart the package i can see which i updated previously. Can I see updated information while i am running my package...? I...
6
2170
by: pramodrepaka | last post by:
hi this is pramod i am facing a small problem Private Sub Command_Click() Dim a As String a = InputBox("enter empno") If rs.State = 1 Then rs.Close rs.Open "select * from microbiology Where bat_num = " & a, cn, adOpenForwardOnly, adLockReadOnly
0
1622
by: nishjee | last post by:
Hello friends, i need visual basic 6.0 code to export a datareport to html other than the defult option coming with datareport. I need this very urgently because when i am exporting the datareport to html using its export option, the column alignments of the report on html format is changing... thats why i am searching for method to do this...
9
2949
smartchap
by: smartchap | last post by:
I have a table having 3 fields viz. SNo, FName and LName. The table has 10 records having SNo from 1 to 10. In DataReport I have 3 labels and 3 textboxes. I want to display all records from 1 to 10 but not to show record No having SNo = 5, i.e. want to hide all label and textboxes in DataReport when SNo = 5. How to hide these on DataReport for a...
1
2299
by: silvia21 | last post by:
I am using ASP and Ms Access. To view the details from table. I have added more than 25 records. so i want to separate the pagewise. First page i want display the 10 record. Next page next 10. plz help me for this coding.
1
3325
by: MaryKJolly | last post by:
I got this sample project from a website. But there is some syntax error in the statement which contains the CDate function. I can't detect the error? Can enybody help me? SUMMARY This article demonstrates basing a DataReport on a parameterized DataEnvironment and refreshing the report when the parameter value changes. MORE INFORMATION 1....
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.