Printing a Crystal Report directly to printer
up vote
0
down vote
favorite
I am creating a label printing function in a program that needs to create labels for the given information. I have created a label in Crystal Reports 9 but I'm having trouble printing it.
I don't want to save the label, I just want it to print directly after the system has created it.
Dim ap9 As craxdrt.Application
Dim rpt9 As craxdrt.Report
Dim dbt As craxdrt.DatabaseTable
Set ap9 = New craxdrt.Application
On Error GoTo errError2
Set iniFile = New CIniFile
On Error GoTo errError3
Set rpt9 = ap9.OpenReport(iniFile.pathReports & REPORT_LABEL_IN)
On Error GoTo errError4
For Each dbt In rpt9.Database.Tables
dbt.Location = iniFile.pathDbCosmet
If dbt.ConnectionProperties.count <= 5 Then
dbt.ConnectionProperties.Add "Database Password", iniFile.passwordCosmet
End If
Next
rpt9.RecordSelectionFormula = sFormula
rpt9.PrintOut False, CInt(txtPacksReceived.Text)
The following code allows me to select a printer
and after clicking 'Print' at that point I am shown another dialog
However, the code executes fine, there are no errors, but the print queue doesn't show any documents and the report doesn't print.
Is there some reason why I'm not able to print my labels?
printing crystal-reports vb6
add a comment |
up vote
0
down vote
favorite
I am creating a label printing function in a program that needs to create labels for the given information. I have created a label in Crystal Reports 9 but I'm having trouble printing it.
I don't want to save the label, I just want it to print directly after the system has created it.
Dim ap9 As craxdrt.Application
Dim rpt9 As craxdrt.Report
Dim dbt As craxdrt.DatabaseTable
Set ap9 = New craxdrt.Application
On Error GoTo errError2
Set iniFile = New CIniFile
On Error GoTo errError3
Set rpt9 = ap9.OpenReport(iniFile.pathReports & REPORT_LABEL_IN)
On Error GoTo errError4
For Each dbt In rpt9.Database.Tables
dbt.Location = iniFile.pathDbCosmet
If dbt.ConnectionProperties.count <= 5 Then
dbt.ConnectionProperties.Add "Database Password", iniFile.passwordCosmet
End If
Next
rpt9.RecordSelectionFormula = sFormula
rpt9.PrintOut False, CInt(txtPacksReceived.Text)
The following code allows me to select a printer
and after clicking 'Print' at that point I am shown another dialog
However, the code executes fine, there are no errors, but the print queue doesn't show any documents and the report doesn't print.
Is there some reason why I'm not able to print my labels?
printing crystal-reports vb6
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am creating a label printing function in a program that needs to create labels for the given information. I have created a label in Crystal Reports 9 but I'm having trouble printing it.
I don't want to save the label, I just want it to print directly after the system has created it.
Dim ap9 As craxdrt.Application
Dim rpt9 As craxdrt.Report
Dim dbt As craxdrt.DatabaseTable
Set ap9 = New craxdrt.Application
On Error GoTo errError2
Set iniFile = New CIniFile
On Error GoTo errError3
Set rpt9 = ap9.OpenReport(iniFile.pathReports & REPORT_LABEL_IN)
On Error GoTo errError4
For Each dbt In rpt9.Database.Tables
dbt.Location = iniFile.pathDbCosmet
If dbt.ConnectionProperties.count <= 5 Then
dbt.ConnectionProperties.Add "Database Password", iniFile.passwordCosmet
End If
Next
rpt9.RecordSelectionFormula = sFormula
rpt9.PrintOut False, CInt(txtPacksReceived.Text)
The following code allows me to select a printer
and after clicking 'Print' at that point I am shown another dialog
However, the code executes fine, there are no errors, but the print queue doesn't show any documents and the report doesn't print.
Is there some reason why I'm not able to print my labels?
printing crystal-reports vb6
I am creating a label printing function in a program that needs to create labels for the given information. I have created a label in Crystal Reports 9 but I'm having trouble printing it.
I don't want to save the label, I just want it to print directly after the system has created it.
Dim ap9 As craxdrt.Application
Dim rpt9 As craxdrt.Report
Dim dbt As craxdrt.DatabaseTable
Set ap9 = New craxdrt.Application
On Error GoTo errError2
Set iniFile = New CIniFile
On Error GoTo errError3
Set rpt9 = ap9.OpenReport(iniFile.pathReports & REPORT_LABEL_IN)
On Error GoTo errError4
For Each dbt In rpt9.Database.Tables
dbt.Location = iniFile.pathDbCosmet
If dbt.ConnectionProperties.count <= 5 Then
dbt.ConnectionProperties.Add "Database Password", iniFile.passwordCosmet
End If
Next
rpt9.RecordSelectionFormula = sFormula
rpt9.PrintOut False, CInt(txtPacksReceived.Text)
The following code allows me to select a printer
and after clicking 'Print' at that point I am shown another dialog
However, the code executes fine, there are no errors, but the print queue doesn't show any documents and the report doesn't print.
Is there some reason why I'm not able to print my labels?
printing crystal-reports vb6
printing crystal-reports vb6
edited Nov 12 at 12:54
asked Nov 9 at 16:02
David
1,53721436
1,53721436
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
I've had problems with Zebra printers in the past that all turned out to be driver related. Have you uninstalled the printer driver and reinstalled it? Otherwise try unplugging and removing the device, plugging it into a different port and trying again?
add a comment |
up vote
0
down vote
Most likely your report doesn't contain any data - some logical error in selection/suppression formulas or similar.
If you print to any other printer, does something print out? Tracing SQL (assuming your report is bound to SQL server), can you see issued query? Does it look correct?
I modified the code so that it displays to a report viewer first and there was data on the report. It doesn't print to any printer, although when I set the first property of.PrintOut
toTrue
the window displayed to confirm the printer, page number etc but even after clicking "Print" it still did nothing.
– David
Nov 12 at 14:05
If you print directly from viewer (it should have print button), does it print? If you run your executable (or vb6) as administrator, does that change anything? We have seen experienced problems with specific printers (zebras are not the worst ones), but some standard printers usually work well. And - what is value ofCInt(txtPacksReceived.Text)
?
– Arvo
Nov 12 at 14:43
Running the .exe as administrator didn't change anything, nor did trying to print it from the viewer.
– David
Nov 12 at 14:51
Hmm, then this may be some Crystal Reports installation issue? (I suppose other programs, like Notepad, can print properly - if not, then it is more like WIndows problem.) We have used CR+VB6 combo maybe for 15 years, I have never seen such problem so far.
– Arvo
Nov 13 at 7:13
I did test a Word document to the regular printer and this didn't print. I removed the label printer, plugged it into a USB port and tried again and the labels printed okay, so I agree that it does seem like a problem with Windows and the USB drivers.
– David
Nov 13 at 9:14
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229262%2fprinting-a-crystal-report-directly-to-printer%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
I've had problems with Zebra printers in the past that all turned out to be driver related. Have you uninstalled the printer driver and reinstalled it? Otherwise try unplugging and removing the device, plugging it into a different port and trying again?
add a comment |
up vote
0
down vote
accepted
I've had problems with Zebra printers in the past that all turned out to be driver related. Have you uninstalled the printer driver and reinstalled it? Otherwise try unplugging and removing the device, plugging it into a different port and trying again?
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I've had problems with Zebra printers in the past that all turned out to be driver related. Have you uninstalled the printer driver and reinstalled it? Otherwise try unplugging and removing the device, plugging it into a different port and trying again?
I've had problems with Zebra printers in the past that all turned out to be driver related. Have you uninstalled the printer driver and reinstalled it? Otherwise try unplugging and removing the device, plugging it into a different port and trying again?
answered Nov 19 at 9:24
Harambe
308117
308117
add a comment |
add a comment |
up vote
0
down vote
Most likely your report doesn't contain any data - some logical error in selection/suppression formulas or similar.
If you print to any other printer, does something print out? Tracing SQL (assuming your report is bound to SQL server), can you see issued query? Does it look correct?
I modified the code so that it displays to a report viewer first and there was data on the report. It doesn't print to any printer, although when I set the first property of.PrintOut
toTrue
the window displayed to confirm the printer, page number etc but even after clicking "Print" it still did nothing.
– David
Nov 12 at 14:05
If you print directly from viewer (it should have print button), does it print? If you run your executable (or vb6) as administrator, does that change anything? We have seen experienced problems with specific printers (zebras are not the worst ones), but some standard printers usually work well. And - what is value ofCInt(txtPacksReceived.Text)
?
– Arvo
Nov 12 at 14:43
Running the .exe as administrator didn't change anything, nor did trying to print it from the viewer.
– David
Nov 12 at 14:51
Hmm, then this may be some Crystal Reports installation issue? (I suppose other programs, like Notepad, can print properly - if not, then it is more like WIndows problem.) We have used CR+VB6 combo maybe for 15 years, I have never seen such problem so far.
– Arvo
Nov 13 at 7:13
I did test a Word document to the regular printer and this didn't print. I removed the label printer, plugged it into a USB port and tried again and the labels printed okay, so I agree that it does seem like a problem with Windows and the USB drivers.
– David
Nov 13 at 9:14
add a comment |
up vote
0
down vote
Most likely your report doesn't contain any data - some logical error in selection/suppression formulas or similar.
If you print to any other printer, does something print out? Tracing SQL (assuming your report is bound to SQL server), can you see issued query? Does it look correct?
I modified the code so that it displays to a report viewer first and there was data on the report. It doesn't print to any printer, although when I set the first property of.PrintOut
toTrue
the window displayed to confirm the printer, page number etc but even after clicking "Print" it still did nothing.
– David
Nov 12 at 14:05
If you print directly from viewer (it should have print button), does it print? If you run your executable (or vb6) as administrator, does that change anything? We have seen experienced problems with specific printers (zebras are not the worst ones), but some standard printers usually work well. And - what is value ofCInt(txtPacksReceived.Text)
?
– Arvo
Nov 12 at 14:43
Running the .exe as administrator didn't change anything, nor did trying to print it from the viewer.
– David
Nov 12 at 14:51
Hmm, then this may be some Crystal Reports installation issue? (I suppose other programs, like Notepad, can print properly - if not, then it is more like WIndows problem.) We have used CR+VB6 combo maybe for 15 years, I have never seen such problem so far.
– Arvo
Nov 13 at 7:13
I did test a Word document to the regular printer and this didn't print. I removed the label printer, plugged it into a USB port and tried again and the labels printed okay, so I agree that it does seem like a problem with Windows and the USB drivers.
– David
Nov 13 at 9:14
add a comment |
up vote
0
down vote
up vote
0
down vote
Most likely your report doesn't contain any data - some logical error in selection/suppression formulas or similar.
If you print to any other printer, does something print out? Tracing SQL (assuming your report is bound to SQL server), can you see issued query? Does it look correct?
Most likely your report doesn't contain any data - some logical error in selection/suppression formulas or similar.
If you print to any other printer, does something print out? Tracing SQL (assuming your report is bound to SQL server), can you see issued query? Does it look correct?
edited Nov 12 at 14:44
answered Nov 12 at 13:18
Arvo
7,68511926
7,68511926
I modified the code so that it displays to a report viewer first and there was data on the report. It doesn't print to any printer, although when I set the first property of.PrintOut
toTrue
the window displayed to confirm the printer, page number etc but even after clicking "Print" it still did nothing.
– David
Nov 12 at 14:05
If you print directly from viewer (it should have print button), does it print? If you run your executable (or vb6) as administrator, does that change anything? We have seen experienced problems with specific printers (zebras are not the worst ones), but some standard printers usually work well. And - what is value ofCInt(txtPacksReceived.Text)
?
– Arvo
Nov 12 at 14:43
Running the .exe as administrator didn't change anything, nor did trying to print it from the viewer.
– David
Nov 12 at 14:51
Hmm, then this may be some Crystal Reports installation issue? (I suppose other programs, like Notepad, can print properly - if not, then it is more like WIndows problem.) We have used CR+VB6 combo maybe for 15 years, I have never seen such problem so far.
– Arvo
Nov 13 at 7:13
I did test a Word document to the regular printer and this didn't print. I removed the label printer, plugged it into a USB port and tried again and the labels printed okay, so I agree that it does seem like a problem with Windows and the USB drivers.
– David
Nov 13 at 9:14
add a comment |
I modified the code so that it displays to a report viewer first and there was data on the report. It doesn't print to any printer, although when I set the first property of.PrintOut
toTrue
the window displayed to confirm the printer, page number etc but even after clicking "Print" it still did nothing.
– David
Nov 12 at 14:05
If you print directly from viewer (it should have print button), does it print? If you run your executable (or vb6) as administrator, does that change anything? We have seen experienced problems with specific printers (zebras are not the worst ones), but some standard printers usually work well. And - what is value ofCInt(txtPacksReceived.Text)
?
– Arvo
Nov 12 at 14:43
Running the .exe as administrator didn't change anything, nor did trying to print it from the viewer.
– David
Nov 12 at 14:51
Hmm, then this may be some Crystal Reports installation issue? (I suppose other programs, like Notepad, can print properly - if not, then it is more like WIndows problem.) We have used CR+VB6 combo maybe for 15 years, I have never seen such problem so far.
– Arvo
Nov 13 at 7:13
I did test a Word document to the regular printer and this didn't print. I removed the label printer, plugged it into a USB port and tried again and the labels printed okay, so I agree that it does seem like a problem with Windows and the USB drivers.
– David
Nov 13 at 9:14
I modified the code so that it displays to a report viewer first and there was data on the report. It doesn't print to any printer, although when I set the first property of
.PrintOut
to True
the window displayed to confirm the printer, page number etc but even after clicking "Print" it still did nothing.– David
Nov 12 at 14:05
I modified the code so that it displays to a report viewer first and there was data on the report. It doesn't print to any printer, although when I set the first property of
.PrintOut
to True
the window displayed to confirm the printer, page number etc but even after clicking "Print" it still did nothing.– David
Nov 12 at 14:05
If you print directly from viewer (it should have print button), does it print? If you run your executable (or vb6) as administrator, does that change anything? We have seen experienced problems with specific printers (zebras are not the worst ones), but some standard printers usually work well. And - what is value of
CInt(txtPacksReceived.Text)
?– Arvo
Nov 12 at 14:43
If you print directly from viewer (it should have print button), does it print? If you run your executable (or vb6) as administrator, does that change anything? We have seen experienced problems with specific printers (zebras are not the worst ones), but some standard printers usually work well. And - what is value of
CInt(txtPacksReceived.Text)
?– Arvo
Nov 12 at 14:43
Running the .exe as administrator didn't change anything, nor did trying to print it from the viewer.
– David
Nov 12 at 14:51
Running the .exe as administrator didn't change anything, nor did trying to print it from the viewer.
– David
Nov 12 at 14:51
Hmm, then this may be some Crystal Reports installation issue? (I suppose other programs, like Notepad, can print properly - if not, then it is more like WIndows problem.) We have used CR+VB6 combo maybe for 15 years, I have never seen such problem so far.
– Arvo
Nov 13 at 7:13
Hmm, then this may be some Crystal Reports installation issue? (I suppose other programs, like Notepad, can print properly - if not, then it is more like WIndows problem.) We have used CR+VB6 combo maybe for 15 years, I have never seen such problem so far.
– Arvo
Nov 13 at 7:13
I did test a Word document to the regular printer and this didn't print. I removed the label printer, plugged it into a USB port and tried again and the labels printed okay, so I agree that it does seem like a problem with Windows and the USB drivers.
– David
Nov 13 at 9:14
I did test a Word document to the regular printer and this didn't print. I removed the label printer, plugged it into a USB port and tried again and the labels printed okay, so I agree that it does seem like a problem with Windows and the USB drivers.
– David
Nov 13 at 9:14
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229262%2fprinting-a-crystal-report-directly-to-printer%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown