Directory
Description
File List
Procedure
Form1.cs
VB. NET
Description
The C #. NET Windows program demonstrates how to create a dataset, add an image to a dataset, and pass the dataset to a subreport at runtime.
File List
-BinDebugCanada.jpg
-BinDebugGermany.jpg
-BinDebugJapan.jpg
-BinDebugUSA.jpg
-App. ico
-AssemblyInfo. cs
-CrystalReport1.cs
-CrystalReport1.rpt
-DynamicImage. csproj
-DynamicImage. csproj. user
-DynamicImage. sln
-Form1.cs
-Form1.resx
-Readme.txt
-Steps.txt
Procedure
* Start a new project/create a dataset and Its Mode
-Create a project
-Code converted to the code behind Form1.cs
-Imports System. Data/System. IO
-Create the function "CreateData" to create a dataset:
DataSet CreateData ()
{
DataSet data = new DataSet ();
Data. Tables. Add ("Images ");
Data. Tables [0]. Columns. Add ("Country", System. Type. GetType ("System. String "));
Data. Tables [0]. Columns. Add ("img", System. Type. GetType ("System. Byte []");
Data. WriteXmlSchema (Directory. GetCurrentDirectory () + "DynamicImage. xsd ");
}
-Create the function "CreateReport" to call CreateData to create a dataset:
Void CreateReport ()
{
CreateData ();
}
-Call CreateReport In the constructor
Public Form1 ()
{
//
// Required for Windows Form Designer support
//
InitializeComponent ();
//
// TODO: Add any constructor code after InitializeComponent call