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
- System. Drawing. Image barcode = IPE. BarCode. BarCodeFactory. GetDMCode (textBeforeEncode );
- System. Drawing. Image enlarged = new System. Drawing. Bitmap (barcode. Width * 4, barcode. Height * 4 );
- System. Drawing. Graphics g = System. Drawing. Graphics. FromImage (enlarged );
-
- G. DrawImage (barcode, 0, 0, barcode. Width * 4, barcode. Height * 4 );
- G. Dispose ();
-
- ...
The pattern is as follows:
On IE, it seems to be a bit vague, and then change it:
Code Snippet
- System. Drawing. Image barcode = IPE. BarCode. BarCodeFactory. GetDMCode (textBeforeEncode );
- System. Drawing. Image enlarged = new System. Drawing. Bitmap (barcode. Width * 4, barcode. Height * 4 );
- System. Drawing. Graphics g = System. Drawing. Graphics. FromImage (enlarged );
-
- G. SmoothingMode = System. Drawing. Drawing2D. SmoothingMode. HighQuality;
- G. CompositingQuality = System. Drawing. Drawing2D. CompositingQuality. HighQuality;
- G. SmoothingMode = System. Drawing. Drawing2D. SmoothingMode. HighQuality;
- G. PixelOffsetMode = System. Drawing. Drawing2D. PixelOffsetMode. HighQuality;
- G. InterpolationMode = System. Drawing. Drawing2D. InterpolationMode. NearestNeighbor;
-
- G. DrawImage (barcode, 0, 0, barcode. Width * 4, barcode. Height * 4 );
- G. Dispose ();
-
- ...
This is OK ....
It took three hours to connect to the deployment and test. It was a cool time.