Click here to Skip to main content
16,005,037 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Comunicate with Hardware in VB.NET Pin
progload17-Oct-05 15:21
progload17-Oct-05 15:21 
GeneralRe: Comunicate with Hardware in VB.NET Pin
kjmorford18-Oct-05 3:45
kjmorford18-Oct-05 3:45 
GeneralRe: Comunicate with Hardware in VB.NET Pin
progload18-Oct-05 9:14
progload18-Oct-05 9:14 
GeneralRe: Comunicate with Hardware in VB.NET Pin
kjmorford18-Oct-05 10:28
kjmorford18-Oct-05 10:28 
QuestionInclude MSComm in .net deployment Pin
naesyttap17-Oct-05 8:19
naesyttap17-Oct-05 8:19 
AnswerRe: Include MSComm in .net deployment Pin
rwestgraham17-Oct-05 9:34
rwestgraham17-Oct-05 9:34 
AnswerRe: Include MSComm in .net deployment Pin
naesyttap19-Oct-05 6:38
naesyttap19-Oct-05 6:38 
QuestionCrystal Reports VB.NET logon failed exception while using Xml file as report datasource Pin
TheBudman17-Oct-05 7:04
TheBudman17-Oct-05 7:04 
Hello I have been dealing with this issue for a week and a half and have been unable to come to an answer.

I am building a windows form project that will sit in the system tray, unviewable to the user. The program will query a database to determine if any new reports need to be ran. if yes then it will pull the required data and manipulate the data into a readable format (the database contains some udf fields that need to be separated into columns) and placed into a datatable which is then added to a new dataset. An xml file is then generated (which is my prebuilt report source, the structure of the report never changes, only the data contained within) and is saved to the harddrive. I then declare a new reportdocument and load the report from the harddrive to the reportdocument. I then specify the default printer name and tell it to print. When i tell it to print it throws a logonexception error. It also does this if i try to export the report.

I have tried using a crystal report viewer to load the report and print, which works fine, but it brings up the print dialog which i cannot have. the reports need to load, print, and close behind the scenes without interaction from the user.

If anyone has any idea why i'm getting this logon exception error even though i'm using an xml file, or how to get past the crystal report viewer showing the print dialog (maybe by forcing the ok button) please let me know. I've been at this for awhile.

CODE:

'add datatable to dataset <br />
dsUDF.Tables.Add(udfData) <br />
<br />
'write xml doc for crystal reports <br />
createXmlDoc() <br />
dsUDF.WriteXml(myXmlWriter, XmlWriteMode.WriteSchema) <br />
<br />
loadReport() <br />
printReport() <br />
<br />
DS.Clear() <br />
dsUDF.Clear() <br />
<br />
Public Sub createXmlDoc() <br />
xmlOut = New System.IO.FileStream("C:\Program Files\HunterReports\ParsedData.xml", IO.FileMode.Create) <br />
myXmlWriter = New System.Xml.XmlTextWriter(xmlOut, System.Text.Encoding.UniCode) <br />
End Sub <br />
<br />
Public Sub loadReport() <br />
report = New ReportDocument <br />
report.Load("C:\visualStudio_Projects\myReports\Youth_Inq.rpt") <br />
report.PrintOptions.PrinterName = Printing.PrinterSettings.InstalledPrinters.Item(0) <br />
End Sub <br />
<br />
Public Sub printReport() <br />
try <br />
report.PrintToPrinter(1, False, 0, 0) <br />
Catch ex As Exception <br />
MsgBox(ex.Message) <br />
End Try <br />
End Sub 

QuestionMsgBox question Pin
Mike0917-Oct-05 5:39
Mike0917-Oct-05 5:39 
AnswerRe: MsgBox question Pin
Dave Kreskowiak17-Oct-05 6:00
mveDave Kreskowiak17-Oct-05 6:00 
GeneralRe: MsgBox question Pin
Mike0917-Oct-05 6:32
Mike0917-Oct-05 6:32 
GeneralRe: MsgBox question Pin
Dave Kreskowiak17-Oct-05 7:54
mveDave Kreskowiak17-Oct-05 7:54 
Questionsending file to my application by right clickling like send to zip file option in windows Pin
Rizwan Bashir17-Oct-05 4:53
Rizwan Bashir17-Oct-05 4:53 
AnswerOmit the question I have done this Pin
Rizwan Bashir17-Oct-05 5:00
Rizwan Bashir17-Oct-05 5:00 
GeneralRe: Omit the question I have done this Pin
Dave Kreskowiak17-Oct-05 5:19
mveDave Kreskowiak17-Oct-05 5:19 
GeneralRe: Omit the question I have done this Pin
Rizwan Bashir17-Oct-05 23:33
Rizwan Bashir17-Oct-05 23:33 
GeneralRe: Omit the question I have done this Pin
Dave Kreskowiak18-Oct-05 11:33
mveDave Kreskowiak18-Oct-05 11:33 
GeneralRe: Omit the question I have done this Pin
Rizwan Bashir19-Oct-05 2:57
Rizwan Bashir19-Oct-05 2:57 
AnswerRe: sending file to my application by right clickling like send to zip file option in windows Pin
kenexcelon17-Oct-05 8:02
kenexcelon17-Oct-05 8:02 
GeneralRe: sending file to my application by right clickling like send to zip file option in windows Pin
Rizwan Bashir18-Oct-05 4:44
Rizwan Bashir18-Oct-05 4:44 
GeneralRe: sending file to my application by right clickling like send to zip file option in windows Pin
Anonymous18-Oct-05 6:38
Anonymous18-Oct-05 6:38 
GeneralRe: sending file to my application by right clickling like send to zip file option in windows Pin
Rizwan Bashir19-Oct-05 3:00
Rizwan Bashir19-Oct-05 3:00 
Questionpopulating combobox Pin
sai_sailendra17-Oct-05 4:53
sai_sailendra17-Oct-05 4:53 
QuestionGraphic Spectrum Analyser like Winamp Pin
men199917-Oct-05 4:35
men199917-Oct-05 4:35 
AnswerRe: Graphic Spectrum Analyser like Winamp Pin
Dave Kreskowiak17-Oct-05 5:15
mveDave Kreskowiak17-Oct-05 5:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.