S
Santosh
Hii..
i am printing crystal reports in asp.net for that purpose i am using
PrintTo Printer method but for that it is needed me to pass printer
name which is installed on my local computer but when i upload it on
server then it gives me an error no default printer . for printing
purpose their is another method in java script window.print() but it
print whole window which includes report toolbar and other buttons but
i want to print only report document.can any one tell me what i can do?
here is the code i am using.
objVillageCryReport.PrintOptions.PaperSource=CrystalDecisions.Shared.PaperSource.Auto;
switch(paperSize_DropDownList.SelectedValue)
{
case "PaperA4" :
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperA4;
break;
case "PaperA4Small":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperA4Small;
break;
case "PaperA3" :
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperA3;
break;
case "PaperB4":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperB4;
break;
case "PaperB5":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperB5;
break;
case "Paper10x14":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.Paper10x14;
break;
case "Paper11x17":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.Paper11x17;
break;
default :
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.DefaultPaperSize;
break;
}
if(portrait_RadioButton.Checked==true)
{
objVillageCryReport.PrintOptions.PaperOrientation=
CrystalDecisions.Shared.PaperOrientation.Landscape;
}
if(Landscape_RadioButton.Checked==true)
{
objVillageCryReport.PrintOptions.PaperOrientation=
CrystalDecisions.Shared.PaperOrientation.Landscape;
}
objVillageCryReport.PrintOptions.PrinterName="Samsung ML-1610 Series"
//printer installed on my local PC;
if(yes_CheckBox.Checked==true)
{
yes_CheckBox.Text="true";
}
else
{
yes_CheckBox.Text="false";
}
objVillageCryReport.PrintToPrinter(Convert.ToInt32(noOfCopies_TextBox.Text.Trim()),
Convert.ToBoolean(yes_CheckBox.Text)
,Convert.ToInt32(startingPage_TextBox.Text.Trim()),Convert.ToInt32(endPage_TextBox.Text.ToString()));
any help greatly appriciated.
i am printing crystal reports in asp.net for that purpose i am using
PrintTo Printer method but for that it is needed me to pass printer
name which is installed on my local computer but when i upload it on
server then it gives me an error no default printer . for printing
purpose their is another method in java script window.print() but it
print whole window which includes report toolbar and other buttons but
i want to print only report document.can any one tell me what i can do?
here is the code i am using.
objVillageCryReport.PrintOptions.PaperSource=CrystalDecisions.Shared.PaperSource.Auto;
switch(paperSize_DropDownList.SelectedValue)
{
case "PaperA4" :
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperA4;
break;
case "PaperA4Small":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperA4Small;
break;
case "PaperA3" :
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperA3;
break;
case "PaperB4":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperB4;
break;
case "PaperB5":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperB5;
break;
case "Paper10x14":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.Paper10x14;
break;
case "Paper11x17":
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.Paper11x17;
break;
default :
objVillageCryReport.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.DefaultPaperSize;
break;
}
if(portrait_RadioButton.Checked==true)
{
objVillageCryReport.PrintOptions.PaperOrientation=
CrystalDecisions.Shared.PaperOrientation.Landscape;
}
if(Landscape_RadioButton.Checked==true)
{
objVillageCryReport.PrintOptions.PaperOrientation=
CrystalDecisions.Shared.PaperOrientation.Landscape;
}
objVillageCryReport.PrintOptions.PrinterName="Samsung ML-1610 Series"
//printer installed on my local PC;
if(yes_CheckBox.Checked==true)
{
yes_CheckBox.Text="true";
}
else
{
yes_CheckBox.Text="false";
}
objVillageCryReport.PrintToPrinter(Convert.ToInt32(noOfCopies_TextBox.Text.Trim()),
Convert.ToBoolean(yes_CheckBox.Text)
,Convert.ToInt32(startingPage_TextBox.Text.Trim()),Convert.ToInt32(endPage_TextBox.Text.ToString()));
any help greatly appriciated.