cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal reports barcode shrink when generate pdf from asp.net mvc

Former Member
0 Kudos

im use following code to generate pdf from crystal report in ASP.NET MVC platform



[HttpGet]
  
public ActionResult ClassCard()
  
{

  
ReportDocument rd = new ReportDocument();

  rd
.Load(Path.Combine(Server.MapPath("~/Reports"), "ClassCard.rpt"));
  rd
.SetParameterValue("ClassName", "Kandy");
  rd
.SetParameterValue("Type", "Group Theory");
  rd
.SetParameterValue("year", "2016");
  rd
.SetParameterValue("Student", "KDG0012");




  rd
.SetDatabaseLogon("DB_74931_rmsecon_user", "snb123");


  
Response.Buffer = false;
  
Response.ClearContent();
  
Response.ClearHeaders();
  
try
  
{
  
Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
  stream
.Seek(0, SeekOrigin.Begin);
  
return File(stream, "application/pdf", "EverestList11.pdf");
  
}
  
catch (Exception ex)
  
{
  
throw ex;
  
}



  
}

this give me pdf as below


http://i.stack.imgur.com/hB2Qi.png

but as you see the barcode is shrinked ,how im solve this problem in ASP.NET MVC enviroment

i saw most people say add registy key ,but i cannot do this coz this is asp.net mvc web application and im going host this app on sheared server

if im Add below regiter keys the problem will solve only for if im generate crystal report in local desktop app please help


Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Search for this KBA - 2165260

It lists a bunch of registry keys you can add to your app server and/or local PC's to stop CRD/SDK from reducing the font.

And Make sure the printer you designed the report on is also the same one being used.

See KBA 2163438 for a sample app to test printing.

Don

Former Member
0 Kudos

Thank you don for your replay .im found the KB article but where im put those reg keys in shared server ?

0 Kudos

The KBA has the path for what ever version of CR and the SDK you have installed.

Don

Former Member
0 Kudos

Dear don

i cant access shared server registry. its only give me host the web app ,so how can i put registry keys?

0 Kudos

Then you need to get access or ask your PC Admininstrator to do it for you.

Don

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear don

its not practical ,do you ever think shared server (godaddy,winhost,1to1) will give access to registry ! and this problem  quite old one , any updated DLL for that problem becoz making changes in registry is not a good solution for every one any help Don?

former_member183750
Active Contributor
0 Kudos

Only godaddy, winhost, 1to1 would know - right? I don't really see that as an SAP issue(?).

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

Got Enhancement ideas? Use the SAP Idea Place

Former Member
0 Kudos

Ludek

if this is not Crystal report issue im not come here .add registry keys is not the always possible ,don't you understands the my issue here ,did sap has update for that PDF issue ,adding registry keys is not the possible solution ,specially for  web apps

ido_millet
Active Contributor
0 Kudos

Amila, your have a valid point there: SAP could expose those options via code, so applications can set the desired behavior without the need to set registry entries.
Consider posting this to the Idea Place.

ido_millet
Active Contributor
0 Kudos

Just added this to the Idea Place: Expose Registry Options (e.g. Font Shrinking on Export) via Code : View Idea

If enough people vote in up, SAP may implement it.

0 Kudos

Thank you Ido,

I sent an e-mail to our DEV owners to see if we could use the App.config file to do this in. We already have a few keys that we use there now so exposing more should be relatively easy to do for them.

But there are so many so not sure if we can do them all or not but the important ones like exporting would be a good start.

Don

ido_millet
Active Contributor
0 Kudos

Using the config file is a good idea.  It will be consistent with how the runtime handles parameter dialog options.  Thanks, Don.