Page 1 of 1

Label Printer Always Printing portrait

Posted: Thu Dec 11, 2014 2:02 pm
by ShakeebAhmed
Dear All

I AM Using a Label Printer in order to print a Label but the report is always printing portrait no matter what i do below is the code i use

Code: Select all

            StiReport  Rep = new StiReport();
            SqlConnection connection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
            DataSet dss = new DataSet();
            SqlDataAdapter sqlAdp = new SqlDataAdapter();
            System.Data.SqlClient.SqlCommand  command = new  System.Data.SqlClient.SqlCommand();
            command.Connection = connection;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "SP_DosePrint";
            command.Parameters.AddWithValue("TransHdrID", Convert.ToInt32(THID));
            connection.Open();
            sqlAdp.SelectCommand = command;
            sqlAdp.Fill(dss);
            connection.Close();
            var reports = from r in hmsDB.Reports where r.EngName == "Dose Print1" select r.StiReport;
            var result = reports.SingleOrDefault().ToString();
                
            Rep.LoadFromString(result);
            StiOptions.Print.UsePrinterSettingsEntirely = true;
            string printername = System.Configuration.ConfigurationManager.AppSettings["LabelPrinter"].ToString();
            PrinterSettings PrinterSetting = new PrinterSettings();
      
            PrinterSetting.PrinterName = printername;
            Rep.RegData(dss);
            Rep.Compile();
            Rep.Render();
                       
            Rep.Print(false, PrinterSetting);
The Printer is Zebra GK420t and the report is landscape so are printing preferences

Please help

Re: Label Printer Always Printing portrait

Posted: Fri Dec 12, 2014 12:24 pm
by HighAley
Hello, Ahmed.

Please, try to set the orientation of the page in the Printer settings.

Thank you.

Re: Label Printer Always Printing portrait

Posted: Sun Dec 14, 2014 7:38 am
by ShakeebAhmed
Dear Aleksey

I Have Tried That and it still prints portrait Please Help

Re: Label Printer Always Printing portrait

Posted: Mon Dec 15, 2014 12:01 pm
by HighAley
Hello.

Could you specify which version of our product do you use?
Please, send us sample of printed label and we need to know the size of the label.

Thank you.