. NET Program tutorial for displaying images in a crystal report using Datasets

Source: Internet
Author: User

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

Related Article

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.