Barcode pattern with SSRS, and pattern enlargement

Source: Internet
Author: User

Today, the subsidiary company needs to add a bar code to the form printed by Microsoft report Service 2005 (SSRS 2005. Ask if we have any plug-ins that can meet this requirement.

The Image of SSRS can be External from the URL. I can say "simple, write it to you in a minute ". I thought it would be easy to use iTextSharp as a web, accept the request parameter as the ticket number, and the response Image format as JPEG. It turned out to be a tragedy.

The key is: what is included in the URL during SSRS running? No. It must be a fixed path graph. Do you want me to write an image file in a temporary directory or something. Another problem with SSRS is that the height of its repeated areas cannot be fixed. Simply put, it is not suitable for printing tables. That's how I convinced myself.

I immediately proposed to use ASP for report viewer instead. Report Viewer certainly uses other controls, not SSRS. I accept it over there. Anyway, their client is only Process. Start iexplorer.exe to display printed documents... And they don't care that much if they can use it. Start now. When the Reporting in RadControls is enabled and the RDL is ready to be imported, it is found that it does not support RDL import. It only supports the report definition import of DevExpress, CrystalReport, and so on. Another tragedy.

Redraw the table in RadControls's Reporting at a high speed, get a Report Viewer control in ASP, and test it again. It has been used for two minutes, and the bar code has not been placed yet. Because RadControls Reporting does not have a QR code, affiliated companies still use iTextSharp to get System. Drawings. Image in the Data Matrix format, and then find that the pattern is very small .... With the scratch size of Reporting itself, the pattern will become unclear. This requires you to resize yourself again. As an idiot, create a new bitmap and redraw it again.

Code Snippet
  1. System. Drawing. Image barcode = IPE. BarCode. BarCodeFactory. GetDMCode (textBeforeEncode );
  2. System. Drawing. Image enlarged = new System. Drawing. Bitmap (barcode. Width * 4, barcode. Height * 4 );
  3. System. Drawing. Graphics g = System. Drawing. Graphics. FromImage (enlarged );
  4.  
  5. G. DrawImage (barcode, 0, 0, barcode. Width * 4, barcode. Height * 4 );
  6. G. Dispose ();
  7.  
  8. ...

 

The pattern is as follows:

On IE, it seems to be a bit vague, and then change it:

Code Snippet
  1. System. Drawing. Image barcode = IPE. BarCode. BarCodeFactory. GetDMCode (textBeforeEncode );
  2. System. Drawing. Image enlarged = new System. Drawing. Bitmap (barcode. Width * 4, barcode. Height * 4 );
  3. System. Drawing. Graphics g = System. Drawing. Graphics. FromImage (enlarged );
  4.  
  5. G. SmoothingMode = System. Drawing. Drawing2D. SmoothingMode. HighQuality;
  6. G. CompositingQuality = System. Drawing. Drawing2D. CompositingQuality. HighQuality;
  7. G. SmoothingMode = System. Drawing. Drawing2D. SmoothingMode. HighQuality;
  8. G. PixelOffsetMode = System. Drawing. Drawing2D. PixelOffsetMode. HighQuality;
  9. G. InterpolationMode = System. Drawing. Drawing2D. InterpolationMode. NearestNeighbor;
  10.  
  11. G. DrawImage (barcode, 0, 0, barcode. Width * 4, barcode. Height * 4 );
  12. G. Dispose ();
  13.  
  14. ...

 

This is OK ....

It took three hours to connect to the deployment and test. It was a cool time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.