Font problem on server side
Font problem on server side
I have a big problem with stimulsoft report, I searched 3 days to find a solution but couldn't find any.
I have set a special font for my report and when I view the report (ViewerEvent) it shows correctly but when I want to "print a report" (PrintReport) the font style is messed up, could anyone help me how to fix it?
I have set a special font for my report and when I view the report (ViewerEvent) it shows correctly but when I want to "print a report" (PrintReport) the font style is messed up, could anyone help me how to fix it?
Re: Font problem on server side
Hello.
Could you specify what viewer do you use?
Please, send us step-by-step instruction how to reproduce the issue.
Thank you.
Could you specify what viewer do you use?
Please, send us step-by-step instruction how to reproduce the issue.
Thank you.
Re: Font problem on server side
I use mvc web viewer
here is my codes:
cshtml file
Controllers:
I also used style.font but doesn't work on server side!
here is my codes:
cshtml file
Code: Select all
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions()
{
Localization = "~/Content/Localization/fa.xml",
Actions =
{
GetReportSnapshot = "GetReportSnapshot",
ViewerEvent = "ViewerEvent",
PrintReport = "PrintReport",
ExportReport = "ExportReport"
},
Theme = StiTheme.Default,
Appearance =
{
BackgroundColor = System.Drawing.Color.Transparent,
},
Toolbar =
{
PrintDestination = StiPrintDestination.Direct,
FontFamily = "BNazanin-Regular",
Alignment = StiContentAlignment.Right
},
Exports =
{
ShowExportToCsv = false,
ShowExportToExcel2007 = false,
ShowExportToDbf = false,
ShowExportToHtml = false,
ShowExportToImageBmp = false,
ShowExportToImageMetafile = false,
ShowExportToImagePcx = false,
ShowExportToImageSvgz = false,
ShowExportToDif = false,
ShowExportToImageTiff = false,
ShowExportToRtf = false,
ShowExportToOpenDocumentCalc = false,
ShowExportToMht = false,
ShowExportToSylk = false,
ShowExportToText = false,
ShowExportToImageGif = false,
ShowExportToExcelXml = false,
ShowExportToXml = false
}
})
Code: Select all
public ActionResult GetReportSnapshot(string sort)
{
if (string.IsNullOrEmpty(Session["__SelectedProjectName"] as string))
{
return RedirectToAction("index", "home");
}
//Stimulsoft.Report.StiStyle style = new Stimulsoft.Report.StiStyle();
//style.Font = new System.Drawing.Font("B Nazanin", 14F);
int pid = int.Parse(Session["__SelectedProjectId"].ToString());
StiReport report = new StiReport();
report.Load(Server.MapPath("~/Reports/Jobs.mrt"));
//report.Styles.Clear();
//report.Styles.AddRange(new Stimulsoft.Report.StiBaseStyle[] { style });
report["@PrjectId"] = pid;
report["@OrderBy"] = sort;
return StiMvcViewer.GetReportSnapshotResult(report);
}
public ActionResult ViewerEvent()
{
return StiMvcViewer.ViewerEventResult();
}
public ActionResult PrintReport()
{
[b][i]//here is the exact problem, the specified font is changed to default font "Arial"
[/i][/b]
return StiMvcViewer.PrintReportResult();
}
public ActionResult ExportReport()
{
return StiMvcViewer.ExportReportResult();
}
Re: Font problem on server side
Hello.
You could use next css on the page with Viewer to add custom font.
Thank you.
You could use next css on the page with Viewer to add custom font.
Code: Select all
@font-face {
font-family: myFirstFont;
src: url(sansation_light.woff);
}
Re: Font problem on server side
I have already defined the @font-face on my css file, but it doesn't work when I print a report, although it works on the viewer page
Re: Font problem on server side
Hello,
Can you please send us a simple test project, which reproduce the issue?
Thank you.
Can you please send us a simple test project, which reproduce the issue?
Thank you.