Sir
I am using Reportviewer version 15.3450.0.29 for preview of barcode label print before print to GC420t printer.
My application is written on asp.net MVC,c#, angularjs , rdlc.
Barcode is generated by placing a image inside rdlc report. i have set the page dimension 5.2cm X 2.6cm.
this barcode have three text , one above the barcode and two below the barcode.
When i print direclty by sending pdf to chrome browser it print perfectly.
But when i show this inside reportviewer, its not shown perfectly. and when i print from reportviewer's print button
then its shrink and barcode images distorted.
sir, please tell me what settings i need to do for correct this problem.
there also a problem 400 as following
http://localhost:4119/api/apiReports/apiSampleBarcodeReport/PrintImage/?key=BAF48087-F5FD-50DB-2423-D0CCD7F3C403^container_Barcode_929869f1-693f-4c05-8cd7-9eacfb16a486&resourcetype=sfimg&isPrint=true 404 (Not Found)
so what is PrintImage i dont have in api
public class apiSampleBarcodeReportController : ApiController, IReportController
{
//Post action for processing the rdl/rdlc report
public object PostReportAction(Dictionary<string, object> jsonResult)
{
//return ReportHelper.ProcessReport(jsonResult, this);
if (jsonResult.ContainsValue("GetDataSourceCredential") && jsonResult.ContainsKey("parameters"))
{
System.Web.HttpContext.Current.Items.Add("parakey", jsonResult["parameters"]);
//System.Web.HttpContext.Current.Items.Add("parakey", 2);
}
return ReportHelper.ProcessReport(jsonResult, this);
}
//Get action for getting resources from the report
/// <summary>
/// Action (HttpGet) method for getting resource for report.
/// </summary>
/// <param name="key">The unique key to get the required resource.</param>
/// <param name="resourceType">The type of the requested resource.</param>
/// <param name="isPrinting">If set to <see langword="true"/>, then the resource is generated for printing.</param>
/// <returns>The object data.</returns>
[System.Web.Http.ActionName("GetResource")]
[AcceptVerbs("GET")]
public object GetResource(string key, string resourcetype, bool isPrint)
{
return ReportHelper.GetResource(key, resourcetype, isPrint);
}
//Method will be called when initialize the report options before start processing the report
/// <summary>
/// Report Initialization method that is triggered when report begin processed.
/// </summary>
/// <param name="reportOptions">The ReportViewer options.</param>
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
//SampleLabelPrinting objslp = new SampleLabelPrinting();
//List<ReportParameter> parameters = new List<ReportParameter>();
//parameters.Add(new ReportParameter() { Name = "ParamBarcode", Labels = new List<string>() { "ParamBarcode" }, Values = new List<string>() { "10250" } });
//reportOption.ReportModel.Parameters = parameters;
//string strHeaderID = "";
//reportOption.ReportModel.DataSources.Clear();
//reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "Sales", Value = objslp.Get_Patient_Sample_Label_Barcode(strHeaderID)});
}
//Method will be called when reported is loaded
public void OnReportLoaded(ReportViewerOptions reportOption)
{
SampleLabelPrinting objslp = new SampleLabelPrinting();
var parameters = new List<Syncfusion.Reports.EJ.ReportParameter>();
if (System.Web.HttpContext.Current.Items.Contains("parakey"))
{
parameters = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<List<Syncfusion.Reports.EJ.ReportParameter>>(System.Web.HttpContext.Current.Items["parakey"].ToString());
System.Web.HttpContext.Current.Items.Remove("parakey");
}
//reportOption.ReportModel.Parameters = parameters;
if (parameters != null && parameters.Count > 0)
{
string strHeaderID = parameters[0].Values[0];
reportOption.ReportModel.DataSources.Clear();
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "SampleBarcode", Value = objslp.Get_Patient_Sample_Label_Barcode(strHeaderID) });
}
}
}
i am attaching two image for your reference
1) Samples image Print from ReportViewer's print button
2) Sample Image print direclty by chrome browser
Attachment:
Image_Samples_9db6571c.rar