Green publishing guide of grid + + report under. Net program


Green publishing guide of grid + + report under. Net program

In sharp wave report, the official development document for CSharp: “in C ා and VB.NET The following is the description of the publishing project

Post your project with VS.NET Production and installation procedures:
1. First create the installation project: right click on the root node of Solution Explorer and execute “add > new project…” in the pop-up menu To create an installation project.
2. Add project release file: right click the newly created installation project node in solution explorer and execute “add > project output…” in the pop-up menu In the open window, select “main output” to automatically add the release file of the program to the installation project.
3. Set the DLL file of grid + + report as com self registration: set the “register” attribute of “gregn6. DLL” and “grdes6. DLL” to “vsdrfcomselfreg” respectively.

C: In C ᦇ and VB.NET Start instructions.txt

In this way, we need to register the COM components that grid + + report depends on to the operating system before running the program. Is there any way to achieve green release?

In order toC:\Grid++Report 6\Samples\CSharp\1.Tutorial\PrintReport\PrintReport.slnFor example, we modified the project to support xcopy deploy

  1. Add to projectFilesFolder
  2. The data file that the project depends on1A. Simple table.grfAndNorthwind.mdbCopy to the files folder and set the file property copy to output directory to always copy.
  3. WillC:\Grid++Report 6\ Copy “gregn6. DLL” and “grdes6. DLL” under the directory to the project, and set the file attribute “copy to output directory” to “always copy”.

After the above three steps, the solution manager should look like this: (I made some changes to the source file and renamed form1 to frmMain.)

Then, the code is modified to read data from the directory where the program is located instead of the installation directory of grid + + report

public FrmMain()
            //Required for Windows Forms Designer support

            //Todo: add any constructor code after the initializecomponent call

            //To load the report template file, you must ensure that the installation directory of grid + + report is under "C: grid + + report 6",
            //For dynamic setting report path and data binding parameters, please refer to other sample programs
            var dir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Files");
            Report.LoadFromFile ( Path.Combine (DIR, "1a. Simple table. GRF"));
            Report.DetailGrid.Recordset.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
                @"User ID=Admin;Data Source=" + Path.Combine(dir, "Northwind.mdb");

If you have the latest version of grid + + report installed on your computer, you will have the following directory:C:\Grid++Report 6\manifest

The two. Manifest files in this directory are the list template files of the grid + + report’s release DLL. Using these two files and adjusting appropriately, we can realize the release without DLL registration. The software developed by grid + + report can realize green publishing.
For more details, please refer to the “report component (C / s report) – > release software > registration free release (recommended)” section of the help document.
YourX86. exe.manifest : 32-bit program manifest file template
YourX64. exe.manifest : 64 bit program manifest file template

C:\Grid++Report 6\manifest\readme.txt

Add a new item “application manifest file” to the project:

After that, it needs to be openedYourX86.exe.manifestFile and will be twofileCopy the contents of the tag to the item’sapp.manifestFile. After this operation is completed,app.manifestThe code for is as follows:

xml version="1.0" encoding="utf-8"?>
 manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
	 version="" name=""/>
				 level="asInvoker" uiAccess="false" />









		 tlbid="{c5a16330-a084-48c9-bc0f-0d0b37a14123}" version="6.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" />
		 clsid="{6edd80cb-9f08-4c71-b406-479e5cb80fce}" threadingModel="Apartment" tlbid="{c5a16330-a084-48c9-bc0f-0d0b37a14123}" progid="grdes.GRDesigner.6" description="Grid++Report Designer 6" />
		 tlbid="{4018f953-1bfe-441e-8a04-dc8ba1ff060e}" version="6.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" />
		 clsid="{f9364159-6aed-4f9c-8baf-d7c7ed6160a8}" threadingModel="Apartment" tlbid="{4018f953-1bfe-441e-8a04-dc8ba1ff060e}" progid="gregn.GridppReport.6" description="GridppReport Class" />
		 clsid="{1b5ea181-a38d-4f42-88b2-6af74cf6d6c0}" threadingModel="Apartment" tlbid="{4018f953-1bfe-441e-8a04-dc8ba1ff060e}" progid="gregn.GRDisplayViewer.6" description="Grid++Report DisplayViewer 6" />
		 clsid="{7fd5dc62-ded0-4138-9c48-55f0a0fe7b66}" threadingModel="Apartment" tlbid="{4018f953-1bfe-441e-8a04-dc8ba1ff060e}" progid="gregn.GRDisplayViewerProps.6" description="GRDisplayViewerProps Class" />
		 clsid="{44cbb5de-5afb-4c3d-8f3f-0f70ca5372ad}" threadingModel="Apartment" tlbid="{4018f953-1bfe-441e-8a04-dc8ba1ff060e}" progid="gregn.GRPrintViewer.6" description="Grid++Report PrintViewer 6" />
		 clsid="{6ca58cb2-2ad1-4ad0-b3cc-5f5c000bbdee}" threadingModel="Apartment" tlbid="{4018f953-1bfe-441e-8a04-dc8ba1ff060e}" progid="gregn.GRPrintViewerProps.6" description="GRPrintViewerProps Class" />

At this point, we can use grid + + report without registering COM components.

The code involved in this article can be found on gitee: xcopy 。

Recommended Today

Memento code examples of PHP design patterns (25)

objective It provides recovery to the previous state (using rollback) or getting the internal state of the object without breaking the encapsulation (the object does not need to have a function that returns the current state). The memo pattern is implemented using three classes: originator, caretaker, and memento. Memento — responsible for storing the unique […]