The. NET program tutorial that uses datasets to display images in Crystal Reports

Source: Internet
Author: User
Tags constructor
Directory
Describe
File list
Steps
Form1.cs
VB.net edition
Describe
This C #. NET Windows program demonstrates how to create a dataset, add images to a dataset, and pass a dataset to a subreport at run time.
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
Steps
* Start a new project/create dataset and its schema
-New Project
-Go to Form1.cs code
-Imports System.data/system.io
-Create the function "Createdata" to create the 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 invoke Createdata to create a dataset pattern:
void CreateReport ()
{
Createdata ();
}
-Call CreateReport in the constructor
Public Form1 ()
{
//
Required for Windows Form Designer support
//
InitializeComponent ();
//
Todo:add any constructor the code after InitializeComponent call

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.