Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Absolute Position In Data Reports


How can you print out an ordered sequence to number the records in a VB data report? The function control won't go into the detail section, and calculated fields only work if you have other fields to calculate from. It seems so easy in Access (number grouping), but why not in VB? Any ideas?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Absolute Position?
Ok back to my datacontrol thing... now I have the record count total but I want to know what record the user is on when they press forward, back, move first, or last in the data control. I have this

Private Sub Data1_Validate(Action As Integer, Save As Integer)
Dim myStr As String
myStr = "Record " & Data1.Recordset.AbsolutePosition & " of " & Data1.Recordset.RecordCount
info.Caption = myStr
End Sub

but the absoluteposition seems to return random things... such as 3 when the text box really displays record 0 and 2 when its really on record number 4. ... am I using this wrong?

complete code


Code:
Option Explicit
Dim rs As Recordset
Dim tCnt As Integer
Dim myPos As Integer

Private Sub Data1_Validate(Action As Integer, Save As Integer)
Dim myStr As String
myStr = "Record " & Data1.Recordset.AbsolutePosition & " of " & Data1.Recordset.RecordCount
info.Caption = myStr
End Sub

Private Sub Form_Load()
CommonDialog1.ShowOpen
Data1.DatabaseName = CommonDialog1.FileName

'Set rs = .OpenRecordset("AUTHORS")
Data1.RecordSource = "branch"
Set Data1.Recordset = rs
Data1.Refresh ' Open the recordset
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
Text1.DataField = "branch_name"
tCnt = 1
End Sub

Absolute Position
Hello...
what the different between selbookmark and absolute position in datagrid...?
i can get the current pointed recordset with that two, can't i ?

how if i do a multiple select ? how absolute position works in multiple select?

thanks,
ganero

.Absolute Position
I have a code errors out telling me I have an invalid key. The code it errors on is as follows:

Do While Not rs.EOF

.Add rs.AbsolutePosition + 1, rs!Site_Number, rs!Site_Number
rs.MoveNext
Loop

(it errors at the .ADD rs line)
I can't find any help on the invalid key error. Anyone have any suggestions?
Thanks
Pat

Absolute Position
I am trying to use rs.absoluteposition to keep incrementing the count on a label, but this always seems to stay at -1. Any ideas?

Thanks!
Erica

Absolute Position In A Query
Hi, using DAO and Access, is there a way to know the exact position of a record in a query ? Like absolute position or something ?
Many Thanks

Absolute Position Of A Record !!!
Friends,

How can I view the number of exact row in a label that is currently showing the data.

Something like this: Record 15 of 75

Help needed please.

Absolute Control Position
ok i want a function 2 find the absolute position of a control on the form.... for example if the control passed in is in 2 pic boxes it will return the twirps to the top left of the form

- i will be doing this kinda thing abit so i need a generic function -

thanks kris

Absolute Control Position?
How can I know the absolute position of a control on a
form, using the upper left corner of the form as 1,1

These controls may be put inside other controls (nested)!

Would anybody help?

Any hint?

Thanks

Absolute Cell Position
Is there any way of obtaining the absolute pixel position of a CELL so that I can use the AddShape position to draw a shape in that cell of equal size and position of that cell?

ie. AddShape(msoShapeOval, Cell.Top, Cell.Left, Cell.Height, Cell.Width)
'Kind of thing'

Many Thanks in advance.
Riyaz

Record Count And Absolute Position
On my form I'm trying to display the number of recoreds in my Access DB and also the current position I'm at but I'm having no luck. Currently i'm using the below but I keep getting -1 of -1 displayed. Can anyone see what is wrong?

Thanks


Code:
strCn = ConnectString()

sSQL = "SELECT * FROM tblBuy ORDER BY Completed DESC, Date DESC"
Set rsEditBuy = New ADODB.Recordset
rsEditBuy.Open sSQL, strCn, adOpenDynamic, adLockOptimistic

lblTrades.Caption = rsEditBuy.AbsolutePosition & " of " & rsEditBuy.RecordCount

Absolute Character Position In Richtext Box
I am trying to auto generate some text in a richtext box. Characters will have different sizes and be of different widths.

I need a way to line up the tabs inbetween things. Sometimes I need 2 tabs, but most of the time I only need 1 inbetween things (Sorry if this is vauge, I will attach an example if needed).

The only way I can think of accomplishing this is by testing the absolute position of a character from the line above and if absolute position of the current character matches that then leave the tabs how they are, otherwise add a tab until the tabs line up.

I searched through the object browser for a good hour testing all the different properties of the richtext lib, and nothing worked. SelTabs looked promising but it always returns 0 for some reason.

Any ideas?

ADO Record Count And Absolute Position
I finally figured out how display the record count of a table or query as well as the absolute record being focused on, but I am getting eroneus numbers -1 of 26 and when I click on the right or left arrow the counter wont increment (or decrement) unles I click the arrow twice. I put the statement in the form load:

Adodc1.Caption = " " & Adodc1.Recordset.AbsolutePosition & " of " & Adodc1.Recordset.RecordCount

and then I put it under the click sub for the Adodc1 control:

Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
Adodc1.Caption = " " & Adodc1.Recordset.AbsolutePosition & " of " & Adodc1.Recordset.RecordCount
End Sub


Any suggestions on how I can get the proper results? Also when a query is run and produces no results, I would like the "counter" to display 0 of 0 instead of -1 of 0 and the control seems to be shaded like Enabled = False. DAVE

Visio - How To Move Shape To Absolute Position?
Hi,

Thanks for taking the time to look at my post.

I would like to move a shape object to an absolute location of my choice, e.g. I would like to know how to move a shape object to position (100, 100).

The selection object's move method only allows the selection to be moved relative to where it's original position was.

here is the code:


VB Code:
Sub start() Dim aShape As ShapeDim aSelection As Selection Set aShape = Documents(1).Pages(1).Shapes(1) ActiveWindow.Select aShape, visSelect Set aSelection = ActiveWindow.SelectionaSelection.Move 2, 2 'i want to move to an absolute location, not just 2 up and 2 right like this line doesEnd Sub


Thanks for your time
<>GT<>

Getting The Absolute Position Of A Control Without Knowing Its Parent
Is there anyway to get the screen coords of a control that doesn't have an hWnd and if you don't know its parent control? I am trying to work on a class and I need to know the top and left of a control relative to a screen (not the window) without passing an hWnd.

Absolute Position A Text Box In Word Macro ??
Hi Guys

Wondering if anyone can tell me if its possible (and how to) absolute position a text box in a word macro....

I have a word document that runs a macro that places a text box on the page containing a barcode. The word document contains text that is editable by the user. However, if the user edits the text, the text box moves as if it is set to position relative to the text. I need the text box to remain in the absolute same spot all the time.

Please, any info on this would be much appreciated.

Nick

Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y

For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);

var w = elem.offsetWidth;
var h = elem.offsetHeight;

var l = 0;
var t = 0;

while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}

return {"left":l, "top":t, "width": w, "height":h};
}

Trying by vb6 in webbrowser

Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document

For x = 0 To doc.getElementsByTagName("a").length - 1

Set elem = doc.getElementsByTagName("a")(x)


I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id

To while loop, but I can't figure it out how

While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend

Next x

Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y

For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);

var w = elem.offsetWidth;
var h = elem.offsetHeight;

var l = 0;
var t = 0;

while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}

return {"left":l, "top":t, "width": w, "height":h};
}

Trying by vb6 in webbrowser

Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document

For x = 0 To doc.getElementsByTagName("a").length - 1

Set elem = doc.getElementsByTagName("a")(x)


I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id

To while loop, but I can't figure it out how

While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend

Next x

Server Side Cursor Recordset Absolute Position
I apologize in advance for this one since I have seen a solution for this some time ago, but cannot seem to turn it up in a search.

 I am using a server side cursor (This will be an advantage for several reasons, so I will not want to change this).

 I only need to determine the recordset absolute position and the recordset count so I can display "Record 1 of 25" or whatever.

 I do a move last then a move first, but still receive the values of -1 for both absolute position and count.

I am using VB6 with SQL Server 7 ADO connection

Terry (cyberbiker)

Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y

For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
    var elem = document.getElementById(elemId);
    
    var w = elem.offsetWidth;
    var h = elem.offsetHeight;
    
    var l = 0;
    var t = 0;
    
    while (elem)
    {
        l += elem.offsetLeft;
        t += elem.offsetTop;
        elem = elem.offsetParent;
    }

    return {"left":l, "top":t, "width": w, "height":h};
}

Trying by vb6 in webbrowser

Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document

For x = 0 To doc.getElementsByTagName("a").length - 1

Set elem = doc.getElementsByTagName("a")(x)


I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id

To while loop, but I can't figure it out how

While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend

Next x

An Absolute Beginners Guide To Passing Data Between Tiers Using XML...anyone?
I have client objects, and server db tier...
Instead of using property bags to buffer the data and pass to my objects DLL I would like to use XML. However...I have seen many different examples, done in many different ways...I am just looking for a bog standard very simple example...

Woka

Fixed Position Of Report Footer In Vb Reports
i am using vb reports and i want to Report Footer on a spesified location,
as data grows or decrease the position of report footer is disturbed
i want to print report on a pre printed paper which has totalrinted on it's end. and company logo and other detail on page.
So any body help me out please.

I also want to email that report in html format.

Data Reports Active Reports Or Crystal Reports
Hi all

I am really stuck here and i need help urgently
I have to call three tables in a row to print a single invoice entry
noe the problem is if the do it by calling single tables then there is a problem that it is nopt going to print the last order which is filled.Is there is any way it can be done through using sql command or something.
Secondly if i use max order in sql then i would not be in a position to print order after searching for it


Thanx

Need To Understand Data Reports - Heard That Crystal Reports Were Slow
I have two questions:

1.) I was going to take a step forward to learn how to use crystal reports but I heard that on a website they are viciously slow. Is that true or is there a way around that with coding?

2.) I have been using Access reports through Visual Basic 6.0 with the following code - thanks for the tremondous help of everyone on this website:

Code:
appAccess.OpenCurrentDatabase SERVER & "disp-1_be.mdb"
appAccess.DoCmd.Maximize
appAccess.DoCmd.OpenReport "oalog", acPreview
appAccess.Visible = True

The reports work great UNTIL I came accross a situation where the report is based off of the data entry of the user. oalog is a monthly report and in the query it automatically pulls the current month with the following query:

Code:
SELECT oalogallmonths.ctsbranch, Count(oalogallmonths.Amount) AS [Total Of Amount], oalogallmonths.GivebyName, oalogallmonths.United, oalogallmonths.Mayflower, oalogallmonths.Other, oalogallmonths.Tord, oalogallmonths.CURRENTDATE, oalogallmonths.Amount, oalogallmonths.Month1, oalogallmonths.ORDER
FROM months, oalogallmonths
WHERE (((months.monthID)=[oalogallmonths].[Amount]))
GROUP BY oalogallmonths.ctsbranch, oalogallmonths.GivebyName, oalogallmonths.United, oalogallmonths.Mayflower, oalogallmonths.Other, oalogallmonths.Tord, oalogallmonths.CURRENTDATE, oalogallmonths.Amount, oalogallmonths.Month1, oalogallmonths.ORDER
HAVING (((oalogallmonths.Amount)=11;

If you notice the records are pulled HAVING the 11th month in there.

If I want the user to ENTER the month I know that I must change the last line to:


Code:
HAVING (((oalogallmonths.Amount)=[ENTER MONTH]));

But a user might type January or 12/2003, etc...

so I made a combobox named ListMonth of the 12 months.
Then I made the change from:


Code:
HAVING (((oalogallmonths.Amount)=11;
to

Code:
HAVING (((oalogallmonths.Amount)=ListMonth.ListIndex + 1));

The only problem is that I keep getting a message box asking for ListMonth.ListIndex + 1.

My question is in the above code that defines appAccess.DoCmd.OpenReport "oalog"...
is there a way to change the RecordSource of the report to pull from my own query instead of the Access Query?

Thanks,
Stephen

Access Reports Vs Visual Basic Data Reports?
I need some help.

For the longest time - I've been using Access Reports that are printed on carbon copy bill of ladings and the like, etc. These reports print only the data that is based on one query. That one query is based on three text boxes on a form. The query searches whatever the user typed in those 3 text boxes and pulls all the records that match. If the user does not type anything in those 3 text boxes they automatically default to '*' in each of the text.

I want to do the same thing in Visual Basic. But I have a better idea for a search. I am using a DataGrid to list everything in a query and basically the user just highlights the row that he wants to choose. Then up top on the menu he clicks on whatever report he wants to print based on the record he/or she highlights. I know I've got to use DataGrid.Columns(0) as a criteria for a search and so I've finish what kind of SQL statement I'm going to use. As regards output, I'm unsure of what to use. I did try to pull up the actual Access Report I used before but that did not work because it would not recognize the DataGrid.Columns(0) command in the query.

I'm new to the Visual Basic Data Report - I don't see any tutorials anywhere.
I understand Crystal Reports are the old way of doing this but don't have a means to try that out.
At this point - in my development - I'm thinking I'd probably make a form that would have the same output with the text boxes tied to the datasource (recordsource would be the query) and then i'd print the form data only. But not sure how to do this either? Please help.

Thanks,

Stephen

Retrieving Images In Crystal Reports And Data Reports
I am saving the image path in the database and retrieving it for display but the problem is when I want to print the image for that particular record when I am only saving the image path in the database.

If I embed the image in the database it increases the size of the database but can be used in the reports in a bounded image control.

If somebody can help me retrieve the image in a data report/crystal report by using the image path in the database that did be great.

Thanks,
Kamran

Grouping Records In Data Reports / Crystal Reports
Hi

I want to group records in my Data Report based on 2 particular fields. Just see the example below.

Below is the Table Structure and its values

UnitID Part Quantity
1 xx 5
1 xy 10
2 xx 5
2 xy 10


Now I want to result to show the summation of quantities based on the part only.

so the result should be

Part Quantity
xx 10
xy 20

It would be fine if someone can tell me how to do this in Crystal report/ VB data reports


Thanks
Kumaran

Crystal Reports, Printing Data Reports
how do you filter records in Crystal Reports using a variable? I'm using Crystal Reports ver. 4.6.1 Why does a time field shown as mm/dd/yy when it should be hh:mm? Is there an easy way to print data reports with filtering or conditions in vb?

Invoking Active Reports(data Reports) From ASP
Hi,
I want to invoke the Active Reports(Data Reports) from my ASP Page.The

Active Reports are created in VB.Also I want to print the Reports from

my ASP Page.If anybody already done this job,Can you help me with the

Sample Code?The reports are working in VB Client.
The reports should stored in the IIS Web server M/c.I need to execute

reports from my ASP page and also I need to print the report output.

Thanks,
Palani.

Extract Data By Position
Hi

Is there a way in VBA to extract data after is has found the text in a file, I have used the application.filesearch object to search for the txt 'housenumber:' in any files that contain HELLO and .doc


i.e.

With fs
.lookin = "c:"
.filename = "HELLO*.doc"
.Searchsubfolders = True
.textorproperty = "House Number:*"
end with

This works ok, Now i want to store what ever comes after House Number: into a variable to be able to query. This number will always be at the same position in the page and will be a max of 3 numbers

Any Suggestions

TIA

NaV

Printing Data Thru Vb As Row,col Position
Hi,

I am using VB6.0 with SQL server 7.0
I would like to print my data on dot matrix printer.

And I want it to print using Row ,Col method like cobol,Foxpro Etc.

How can I do this ?

Please reply as early as possible


Regards,

Shrikant

Data Label Position In Pie Chart
I have to reposition the datalabel in pie chart for which I have written followin piece of code:
With .SeriesCollection(0).DataLabelsCollection.Add

.HasValue = False
.HasPercentage = True
.HasCategoryName = True
.Position = chLabelPositionInsideEnd
.Separator = "-"

End With
.Position = chLabelPositionInsideEnd
But their is no effect.Help

Stacked Bar Graph - Data Label Position?
I was wondering how you can position the data labels on a stacked bar graph to appear outside the end of each bar rather then inside. I know some graphs allow for the use of xlLabelPositionOutsideEnd but that does not seem to be an option for the stacked bar graph. Any help would be great!

Search For Data Position In String Or Array
Hello Peps

I am suffering from mental block.

I used a command a long time ago which returned the position of data in an array (or delimited string).

I am not talking about the Instr command :-)

Does anyone know what I mean?

Position Cursor Within Textbox Data With Setfocus?
Is there a way to position the cursor within a textbox?  For instance, when a user clicks the "Add" button, a textbox is auto populated with the first 9 characters of an ID; the user enters the remaining 4.  But the cursor is positioned at the left of the text in the textbox instead of the right where the user really needs to be to begin entering.

I've tried not to use a setfocus and rely on tab order but it places cursor at the left instead of the right.  

I also formatted the text box to right justify, but again the cursor is placed to the left.

Any ideas?

Thank you,
Michelle

Print A Single Record Using The Data Environment And Data Reports
I would like you use the data enviroment and data reports to print out a single record.
I have a form set-up and textboxes related to a data control. When you scroll through the data control it displays each field in its own respective textbox.
I have call a report (setup using a table query) and it will give me all records in that database on that report.
How can I genterate a report on just the record that I am looking at?
I could really use some help on this one... any feedback would be greatly appreciated.

How To Find Position Of Tags In A Binary Data-string?
Hi VB-Experts:

I import a non-VB file into a string and want to analise it with function "InStr" to know the positions of some specials tags. I know the HEX-Code of the tags, but I see no way to search for it via VB-Code. ???

Hans

Placing Cursor To Desired Position In Data Grid.
I am using SelBookmarks to select multiple rows. I want to restore cursor position to first row that matches selection criteria . How do I do that.

Please advice.

DK.

Linking Data Reports To Flexgrids As Source Data?
I need to create a report, however the data that the report needs to use resides in a disconneted recordset which is linked to a datagrid on another form. it's not stored in a table anywhere. the recordset data is generated at runtime so there is no way for me to query the data from an external table.

can I somehow link the data report to the disconnected recordset?

Data Reports And Data Environment: How To Get Multilevel Exprssion
Can anyone give me a clue as to how to express the grouping logic below on a VB Data Report? This is the second and third portions of a three way union that works just hunky-dory in an Access report. When I try to use the Data Environment designer to group the various attributes, there seems to be a problem with query parameters. I keep getting the error message "All required parameters must be linked with parent object" when I try to add a parameter to the any child level.

In my query for the Access report, I use the SQL below successfully [The SQL editor does about ten passes over it when I open the window, but it crunches it just fine.] I have the report banded as follows
AccountClass from AccountType linked on AccountType.AccountType=Account.AccountType
AcountSubclass from Account linked on Account.AccountNumber=Ledger.AccountNumber
AccountNumber from Ledger-Journal-Account query as basis for inner group of sums
Date ordering within the group -- and as parameter comparison condition
for beginning and end dates of period covered -- right now, begin date only
TransactionNumber as secondary ordering



Anyway, when I put the detailed query out at the end of the chain, it wants a link on the date parameter to the parent field. When I add a parameter to the root node, a very sparse query into AccountType, it does not let me propogate the parameter downward. I find this quite frustrating, as the parameter is irrelevant except for filtering at the grandchild level.

Anyway, here is the SQL code:

select lines.TransactionNumber, lines.Debit as Debits, Null as Credits,
0-lines.Debit as balance, AccountName, AccountNumber, Account.AccountType, AccountSubtype, AccountClass,
Journal.Memo, Journal.date as DateLine
from Journal,
(select distinct(Ledger.TransactionNumber), Ledger.Debit, Ledger.Credit,
accounts.AccountName, accounts.AccountNumber, Account.AccountType, Account.AccountSubtype, AccountClass
from Ledger, (select AccountNumber, AccountName, Account.AccountType,
AccountSubtype, AccountName,
AccountClass
from Account, AccountType
where Account.AccountType = AccountType.AccountType) as accounts
where Ledger.AccountNumber = accounts.AccountNumber ) as lines
where Journal.TransactionNumber=lines.TransactionNumber and
date &gt; [date_arg] and
lines.Debit&gt;0


UNION select lines.TransactionNumber, Null as Debits, lines.Credit as Credits,
lines.Credit-lines.Debit as balance, AccountName, AccountNumber, Account.AccountType, AccountSubtype, AccountClass,
Journal.Memo, Journal.date as DateLine
from Journal,
(select Ledger.TransactionNumber, Ledger.Debit, Ledger.Credit,
accounts.AccountName, accounts.AccountNumber, Account.AccountType, Account.AccountSubtype, AccountClass
from Ledger, (select AccountNumber, AccountName, Account.AccountType, AccountSubtype, AccountName,
AccountClass
from Account, AccountType
where Account.AccountType = AccountType.AccountType) as accounts
where Ledger.AccountNumber = accounts.AccountNumber) as lines
where Journal.TransactionNumber=lines.TransactionNumber and
date &gt; [date_arg] and
lines.Credit&gt;0
ORDER BY AccountNumber, DateLine, TransactionNumber;




I run that in Access and I can generate nice reports banded as shown above. Any suggestions as to how to arrange the icons in the Data Environment, and get the same efect? Or would it be possible to use code to assign the neccesary traits to an ADODB.Command object? Right now, I'm feeling quite frustrated with the whole VB report design process.

Thanks for any tips you can provide.


Joseph

Showing Data In Different Format In Data Reports
I have made a data report by binding the data source at run time. I want to show some records in one color and some records in different color.

Eg: I have 100 records in a recordset, according to the data in one of the field in recordset, i want to show 50 records in green color and 50 in red color.

Do we have any method where by this problem can be solved ?



Thanks

Data From Application Path In The Data Reports
How can I get the data report to fetch the data from the database situated in the application folder, as the connection I make always uses the static path that i give in the space provide, but my project path & in the context the application path changes & thus it generates the error every time i get to the data report.

Could somebody help me?

Even changing the connection string at runtime dont work.

Data Environment And Data Reports Error
I am creating a program using ADODB to connect to my database, I would like to be able to create reports using Data Environment with the information from the database, The database is password protected, and I am using an access 2000 database instead of the Visual Data Manager to connect to the database.

My problem is while I am setting up the properties in the Data Link Properties dialog box I select the database, enter the password, choose jet 4.0 as my ole db provider. when I click test Connection, i get an error that says:

"Test connection failed because of an error in initializing provider. Can't start your application. The workgroup information file is missing or opened exclusively by another user."

if i unset the password the connection works but i would prefer to have the database password protected any ideas on how to do this properly??



optexx

How To Get Data From Different Tables Of A Database Into Data Reports
Hi,

Please help me to know that how to get data from different ta
bles to data reports.
I am using code like this

' rs is recordset of
adodb.recordset and cn is connection of 'adodb.connection

set rs=cn
.execute("select * from tablename")

set Datareport1.DataSource=rs

datareport1.show

Please tell me how to execute to get data from differ
ent tables which are independent

Thank you

*** Resolved-somewhat *** Grouping Data In Data Reports
I am trying to print out a report using data reports. Thanks to some awesome members here I have now got a working report that prints out the data from my database based on a chosen date.

My problem is that I need to do some grouping of the data based on one of the fields in the database. When I followed the tutorial in the MSDN I ended with the error that the report is wider than the paper. I am not sure how this is happening because I can display this report without the grouping and it fits on the paper. I also find that when I change things in the data environment and then try to add a new header to do the grouping by I cannot drag my field from the new grouping command onto my new header.

Attached is a zip file with my project and database. In it's present form it works great but it doesn't do any grouping. I have included an excel file and a Word file that shows the type of format I am looking for. I will try to head off a couple of questions here:

1. Yes I do want 2 or 3 extra spaces between each of the pickup time groupings. That way they can write in additions to the schedule which sometimes happens.

2. I can have pickup times starting as early as 8 AM and ending at 4 PM Normally they only occur on the hour but that is set up in my actual program and database.

3. If I have too many appointments in one day to fit on one page I want to split it onto 2 pages and place the AM on page one and the PM on page two.

If there are other questions I will be back on to check this post in about 12 hours from now.

Thanks to everyone who even reads this post because you at least are willing to help. I really do appreciate any help given and if someone just wants to guide me to the resources I am willing to try to solve this myself. Please understand that I do research and try many things before I post here but when I post here I am usually quite stumped at that point.

Thanks again everyone. Later,


Cliff R.
Mesa, AZ
Check out my website at http://crogers.org
Being an organ donor is giving the greatest gift that someone can give.
It is giving the gift of life. Please register to be an organ donor.


Edited by - crogers on 9/24/2005 8:10:35 PM

Data Reports And Data Environment-Still Not Resolved
Hi, I have been posting this question on this site for a few days now and nobody seems to be able to help me with it. Here goes one last time:

I have this SQL statement in my data environment.

SELECT customer.first_name, customer.last_name, orders.estimate_number AS Expr1, estimateMaterial.material_id, estimateMaterial.quantity, inventory.description FROM customer, orders, estimateMaterial, inventory WHERE customer.customer_id = orders.customer_id AND orders.estimate_number = estimateMaterial.estimate_number AND estimateMaterial.material_id = inventory.material_id GROUP BY customer.first_name, customer.last_name, estimateMaterial.material_id, estimateMaterial.quantity, inventory.description, orders.estimate_number HAVING (orders.estimate_number = ?)

When I click on the estimate number I would like a report on, it prints out the following:

bill
thomas
181
6704
1
Lug

bill
thomas
181
6705
receptacle

The problem is I just want it to print:
bill thomas
181
6704 Lug 1
6705 receptacle 1

Why does it print the name and estimate #(181) twice? I just want it to print it once followed by the items in inventory.

Please only answer if you are sure of what you are doing as I can't waste any more time on wild goose chases.
thank you very much in advance.



thanks
leadfinger
http://www3.nbnet.nb.ca/gspil

Edited by - leadfinger on 4/26/2003 4:35:20 AM

Data Reports (Data Environment, Recordset)
Hi All

I am currently in the process of reporting information from the database I have created and was wondering what is the best way to approach this. The results are produced by an SQL query that the user creates and is different every time, serveral users could run this at any time too.

I need to be able to pull results out and display them on the form/ data report. The titles of the fields will be the same as the recordset field values, and the number of fields/rows will vary with each query, this information can be easily obtained. The results for each of these to be displayed underneath also in labels.

I am having a number of problems, firstly I cant seem to be able to pass an sql query to a command of a dataenvironment and I dont want to use the properties of the comand as this is static, it needs to be passed at run-time, different queries are passed each time.

So far I have tried to set up everything in run-time as with ADO but I was having no end of problems with the code and getting the objects i.e. dataenvironment SET. I have never seen any examples of this being done from scratch so I have nothing to go on, most people create these at design time which I am trying to avoid.

Because I was having so many problems I was wondering if I should avoid data environment and create a recordset directly like:
Set recSelect = dB.OpenRecordset(strSQL, dbOpenSnapshot) - this works
and then create the necessary label objects at run-time (set their value, i.e. positioning etc) and then display the necessary data in these, this sounds inefficient though and makes no use of the data Environment.

Is there any way of obtaining the same outcome through data environment and would it be easier and more efficient to use, if so how?

In terms of the current method, I have no problems creating a recordset however I am experiencing difficulties with creating lblboxes at run-time, as the number of these will be the same as the number of fields/ rows as in recordset.fields.count etc, the boxes will therefore have to be part of an array - I am not to sure how to do this either as it doesn't seem to want to create and set label objects when they are part of an array i.e. Dim lblFields(i) as label (newline) set lblfields(i) = new label. Setting their propeties (position etc)and values probably won't be much of a problem.

At a later stage to the right of this I want to create a kinda gridded layout with dates at the top and the corresponsding rows will be coloured based on data information contained within the database, these will be inline with the other information record by record etc - this could effect the method I use now I suspect. Can u also freeze a row on a datareport that sticks when u scroll across like in Excel?

Cheers again

Rusty



Edited by - Rusytness on 7/1/2002 2:55:12 PM

Problem With Data Environment And Data Reports
Hi Gurus,

We are working on a VB project. For report generation we are using DataEnvironment and Data Reports. In this regard i have some problems.

1. Is there any limit on number of DataReports that can be generated in a project? Because if the number of reports exceeds 30, we are unable to add a new report.

Error Path.
i. Select a DataReport from Project menu.
ii. Drag command contents from DataEnvironment into newly added DataReport.
iii. Select DataSource for DataReport.

During the third operation we are getting the following error.
"Out Of Memory".
Then the project closes abruptly saying "VB 6 Has caused illegal operation"

When the project is opened again an error message is diplayed stating
"Reading From Registry - 0xff558880000 has refernce 0x00000000 in registry"

Please help us out of this problem
Thanks in advance.

How Would I Position My Form At The Current Caret Position (like The Menu For Inserting Stuff In Msv
How would i position my form at the current caret position (like the menu for inserting stuff in msvb6)

Data Report Changing Position Of Text2 Based On Length Of Text1 Field While Pringing.
Data report changing position of text2 item dynamically based on length of text1. I am using dataenvironment as a record source in the report for example,

10 start text 2 from here
10.10start text 2 from here
10.10.10start text 2 from here
10.10 start text 2 from here

It is possible ?.


Thanks,

Copyright © 2005-08 www.BigResource.com, All rights reserved