|
-
Jan 29th, 2003, 06:37 AM
#1
Thread Starter
Addicted Member
i need some help, what wrong with my code...?
Hi, i need some help... what is wrong
the report loads, but no data show on the chart, it "sums" the values. i need to display all the values...???
i need to produce a crytal report that
has a chart which displays
the data between certain date/time fields
depending on selected items
from an inSql database
code for getting data from inSql:
PHP Code:
Dim strStart As String = txtStartDate.Value & " " & txtStartTime.Value
Dim strEnd As String = txtEndDate.Value & " " & txtEndTime.Value
Dim strItem1 As String = DropDownList1.SelectedItem.Value
Dim strItem1 As String = DropDownList2.SelectedItem.Value
Dim StartDate As DateTime
Dim EndDate As DateTime
Dim Item1 As String
Dim Item2 As String
Dim conDB = Server.CreateObject("ADODB.Connection")
conDB.Connectiontimeout = 300
conDB.Commandtimeout = 300
conDB.Open("Provider=SQLOLEDB.1;Persist Security Info=False;User ID=vwUser;Data Source=Server1;Use Procedure for Prepare=0;Auto Translate=True;Packet Size=4096;User Id=vwUser;PASSWORD=Password;Initial Catalog=Database1;")
Dim rs = Server.CreateObject("ADODB.Recordset")
StartDate = CDate(strStart)
EndDate = CDate(strEnd)
Item1 = CStr(strItem1)
Item2 = CStr(strItem2)
rs.Open("Select * from InSQL.Database1.dbo.Table where (item = '" & strItem1 & "') or (item= '" & strItem2 & "')", conDB)
code for chart:
PHP Code:
Dim CRCreport As New CrystalReport1()
CRCreport.SetDataSource(rs)
Fname = System.IO.Path.GetTempPath() & Session.SessionID.ToString & ".pdf"
crDiskFileDestinationOptions.DiskFileName = Fname
With CRCreport.ExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
CRCreport.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
-
Jan 29th, 2003, 11:46 AM
#2
Hyperactive Member
VB Code:
Dim strItem1 As String = DropDownList1.SelectedItem.Value
[b]Dim strItem1 As String = DropDownList2.SelectedItem.Value[/b]
Perhaps that should that be:
VB Code:
Dim strItem[b]2[/b] As String = DropDownList2.SelectedItem.Value
?
-
Jan 29th, 2003, 01:24 PM
#3
Sleep mode
maybe something rong with your sql statement , ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|