Home > database >  Need to add a watermark to ReportingServices2008r2 statements, you have any good Suggestions?
Need to add a watermark to ReportingServices2008r2 statements, you have any good Suggestions?

Time:10-02

There are about 300 stock report, how to add batch?
You need to add on the working and the current time,

CodePudding user response:

1: watermark generated code
Using System;
using System.Data;
Using System. The Configuration;
using System.Drawing;
Using System. Drawing. Imaging;

///& lt; summary>
///WatermarkCreater summary description
///& lt;/summary>
Public class WatermarkCreater
{
Public WatermarkCreater ()
{
//
//TODO: join construct the function code in the
//
}

Private Bitmap CreateImage (string code, string width, the string height, string pLeft, string pTop, string the font, string fColor, string bColor, string r)
{
Color the cF=Color. FromArgb (int. Parse (fColor. Substring (2, 2), System. Globalization. NumberStyles. AllowHexSpecifier), int. J Parse (fColor. Substring (4, 2), System. Globalization. NumberStyles. AllowHexSpecifier), int. J Parse (fColor. Substring (6, 2), System. Globalization. NumberStyles. AllowHexSpecifier));
Color cB=Color. FromArgb (int. Parse (bColor. Substring (2, 2), System. Globalization. NumberStyles. AllowHexSpecifier), int. J Parse (bColor. Substring (4, 2), System. Globalization. NumberStyles. AllowHexSpecifier), int. J Parse (bColor. Substring (6, 2), System. Globalization. NumberStyles. AllowHexSpecifier));

System. Drawing. SolidBrush sb=new SolidBrush (cF).
String [] FSTR=the font. The Split (', ');
The Font f=new Font (FSTR [0]. The Split ('=') [1], (float) Convert. ToInt32 (FSTR [1]. The Split ('=') [1]), FontStyle. Regular, (GraphicsUnit) Convert. ToInt32 (FSTR [2]. The Split ('=') [1]), the Convert. ToByte (FSTR [3]. The Split ('=') [1]), the Convert. ToBoolean (FSTR [4]. The Split ('=') [1]));
Bitmap BMP=new Bitmap (Convert ToInt32 (width), Convert the ToInt32 (height));
Graphics g=Graphics. FromImage (BMP);
Right to Lear (Color. White);
G.R otateTransform ((float) Convert ToDouble (r));
G.D rawString (code, f, sb, new PointF (Convert. ToInt32 (pLeft), Convert the ToInt32 (pTop)));

Return BMP.
}

Public byte [] GetImageByte (string code, string config)
{
String [] configs=config. Split ('; ');
Bitmap im=CreateImage (code, configs [0]. The Split (' : ') [1], configs [1]. The Split (' : ') [1], configs [2]. The Split (' : ') [1], configs [3]. The Split (' : ') [1], configs [4], configs [5]. The Split (' : ') [1], configs [6]. The Split (' : ') [1], configs [7]. The Split (' : ') [1]).
System. IO. MemoryStream ms=new System. IO. MemoryStream ();
Im. Save (ms, ImageFormat. Bmp);
Return Ms. GetBuffer ();
}
}
2: keep the watermark to the database, the database type for image

3: the watermark query, as a data source into reports, and then the report can be added to the background of

  • Related