Mxl than to open. Mxl than open 1s 8.3 file save dialog

Home / Data Recovery

Time moves inexorably forward, and the 1C 8 platform runs even faster than this time.

Managed forms are now called the "TAXI interface", modal windows are prohibited, and the mode of using synchronous calls to extensions and external components has completely stopped the functionality of most of these extensions and external components, and half of the old methods in addition.

In general, guys, things are like this - many of you have read the article by the magnificent P. Chistov about working with files in 8.3

If you haven't done this yet, go ahead and march! ()

The essence of the mechanism for working with files in brief:

1) On the client, select the file

2) We shove it into a black box

3) Save the contents of the black box on the server

The catch is that this must be done especially, in a new way and with soul.

Therefore your

SelectedFile.Exists()

and other pagan things will not work here.

So, let's go!

Here is a code listing that allows you to download a file from the client

Alert Description = New Alert Description("ProcessFileSelection", ThisForm); OpenFileDialog = NewFileSelectDialog(FileSelectDialogMode.Open); FileOpenDialog.MultipleSelect = False; StartFilePlace(AlertDescription, FileOpenDialog, True, UniqueIdentifier);

We are interested in the method " StartPlaceFiles", which, in fact, calls up a file selection dialog and places this file in temporary storage. There is no point in bothering with the description of temporary storage, just remember - this is the place where all the files we select are placed in the form of binary data (black box).

&On the Client Procedure ProcessFileSelection(PlacedFiles, AdditionalParameters) Export If PlacedFiles = Undefined Then Return; endIf; For each TransferredFile From PlacedFiles Cycle PathToFile = TransferredFile.Name; Record.FileName = ParseLine(PathToFile, "\"); Items.OpenFile.Header = Entry.FileName; Address = TransmittedFile.Storage; EndCycle; EndProcedure // ()

It is almost impossible to understand what is there and how to store it in this temporary storage. You can only access our file using the navigation link, which is assigned automatically (see variable " Address").

With the fact that files need to be stored in an attribute or resource with the type " Value storage", I think no one will argue. Get the file from temporary storage and place it in an attribute with the type " Value storage" can be done as follows:

NewValueStorage(GetFromTemporaryStorage(Address));

We've sorted out one thing, now the second thing is how to get a file from this value store (which, let me remind you, is located on the server) and save it to the client's disk?

First of all, we need to get a navigation link to the attribute with type " Value storage", where we place the file in the form of binary data.

Be careful! This navigation link no longer has anything to do with temporary storage! You can check the type of navigation link using the method

This is the Temporary Storage Address (Address)

By tradition, the code listing that calls the file save dialog

Alert Description = New Alert Description("File Saving Processing", ThisForm); File = New DescriptionofTransferFile(FileName, Address); ReceiveFiles = New Array; ReceiveFiles.Add(File); OpenFileDialog = NewFileSelectDialog(FileSelectDialogMode.Save); FileOpenDialog.MultipleSelect = False; StartReceivingFiles(DescriptionAlerts, ReceivingFiles, OpenFileDialog, True);

Variable value " File"This is another feature this method. Here it is worth paying attention to " File name"The fact is that when placing a file in temporary storage, information about its name and extension is lost. Therefore, do not forget to save the correct file name, or at least its extension, somewhere, so as not to be bothered with the question later" Is this a Word document or an MP3?"

Method " Start Receiving Files"similar to method" StartPlaceFiles". Simply one opens a dialog to select a file, while the other, on the contrary, opens a dialog to save the file.

That's basically it.

When using this method, there is no need to set any modality and synchronous call compatibility in the configuration properties.

I wrote the article more as a reminder for myself.

Time moves inexorably forward, and the 1C 8 platform runs even faster than this time.

Managed forms are now called the “TAXI interface”, modal windows are prohibited, and the mode of using synchronous calls to extensions and external components has completely stopped the functionality of most of these extensions and external components, and half of the old methods in addition.

In general, guys, things are like this - many of you have read the article by the magnificent P. Chistov about working with files in 8.3

If you haven't already done so, go ahead and march! ()

The essence of the mechanism for working with files in brief:

1) On the client, select the file

2) We shove it into a black box

3) Save the contents of the black box on the server

The catch is that this must be done especially, in a new way and with soul.

Therefore your

SelectedFile.Exists()

and other pagan things will not work here.

So, let's go!

Here is a code listing that allows you to download a file from the client

Alert Description = New Alert Description("ProcessFileSelection", ThisForm); OpenFileDialog = NewFileSelectDialog(FileSelectDialogMode.Open); FileOpenDialog.MultipleSelect = False; StartFilePlace(AlertDescription, FileOpenDialog, True, UniqueIdentifier);

We are interested in the method “ StartPlaceFiles“, which, in fact, calls up a file selection dialog and places this file in temporary storage. There is no point in bothering with the description of temporary storage, just remember - this is the place where all the files we select are placed in the form of binary data (black box).

&On the Client Procedure ProcessFileSelection(PlacedFiles, AdditionalParameters) Export If PlacedFiles = Undefined Then Return; endIf; For each TransferredFile From PlacedFiles Cycle PathToFile = TransferredFile.Name; Record.FileName = ParseLine(PathToFile, "\"); Items.OpenFile.Header = Entry.FileName; Address = TransmittedFile.Storage; EndCycle; EndProcedure // ()

It is almost impossible to understand what is there and how to store it in this temporary storage. You can only access our file using the navigation link, which is assigned automatically (see the variable “ Address“).

With the fact that files need to be stored in an attribute or resource with the type “ Value storage“I don’t think anyone will argue. Get the file from temporary storage and place it in an attribute with the type “ Value storage” can be done as follows:

NewValueStorage(GetFromTemporaryStorage(Address));

We’ve sorted out one thing, now the second thing is how to get a file from this value store (which, let me remind you, is located on the server) and save it to the client’s disk?

First of all, we need to get a navigation link to the attribute with type “ Value storage“, where we place the file in the form of binary data.

Be careful! This navigation link no longer has anything to do with temporary storage! You can check the type of navigation link using the method

This is the Temporary Storage Address (Address)

By tradition, the code listing that calls the file save dialog

Alert Description = New Alert Description("File Saving Processing", ThisForm); File = New DescriptionofTransferFile(FileName, Address); ReceiveFiles = New Array; ReceiveFiles.Add(File); OpenFileDialog = NewFileSelectDialog(FileSelectDialogMode.Save); FileOpenDialog.MultipleSelect = False; StartReceivingFiles(DescriptionAlerts, ReceivingFiles, OpenFileDialog, True);

The value of the variable “ File“This is another feature of this method. Here it is worth paying attention to “ File name“. The fact is that by placing a file in temporary storage, information about its name and extension is lost. Therefore, do not forget to save the correct file name somewhere, or at least its extension, so that you don’t have to worry about the question “ Is this a Word document or an MP3?

Method “ Start Receiving Files” similar to the method “ StartPlaceFiles“. One simply opens a dialog for selecting a file, while the other, on the contrary, opens a dialog for saving the file.

That's basically it.

When using this method, there is no need to set any modality and synchronous call compatibility in the configuration properties.

I wrote the article more as a reminder for myself.

The 1C:Enterprise 8 technology platform allows you to save arbitrary files in the information base, retrieve them from there and use them in various ways. Let's look at these operations using examples.

Before uploading a file to the 1C information base, you need to obtain the full address of the file on disk. Working with file selection dialogs is described in .

To store files, use an attribute (or register resource) with the type StorageValues.

Uploading an arbitrary file to the 1C information base

Any file can be represented as binary data and loaded into Value Storage.

When converting binary data to an object StorageValues design used new StorageValues(Data, Compression) with two parameters:

  1. Data— binary data that needs to be stored in storage
  2. Compression— compression ratio of the Deflation algorithm. Integer in the range -1...9. -1 is the default compression level. 0 - no compression, 9 - maximum compression. Default value: -1. The parameter is optional; if not specified, then compression is not used.

//Convert the file to binary data
File = New BinaryData(Path) ;

//Create new object StorageValues

DataStorage = NewValueStorage(File, NewDataCompression(9) ) ;

Saving an arbitrary file from the 1C infobase to disk

To save a file from the 1C database to disk, you need to determine the path and file name. To do this, there is a file saving dialog, working with which is described in.

//Get binary data from storage
//Data Storage - attribute of an object with the Value Storage type

//Write the received data to disk
//The Path variable contains the full address of the file on disk
Data. Write(Path) ;

Viewing a file located in the 1C information base

To view a file saved in the database, you must have an application installed on your computer that opens the file.

//Get the name of the temporary file with the required extension
//In the Extension variable you need to put the file extension, for example "pdf"
Path = GetTemporaryFileName(Extension) ;

//Receive data from storage
//Data Storage - attribute of an object with the Value Storage type
Data = Datastore. Get() ;

//Write data to a temporary file
Data. Write(Path) ;

//Trying to open the file in the intended application
//If the application is not found, the system dialog "Open with..." will appear.
LaunchApplication(Path) ;

The program "1C:Enterprise - Working with Files" is a separate software product, which is distributed free of charge. It is intended for viewing and editing 1C:Enterprise files on computers where the 1C:Enterprise system is not installed.

The following file formats are supported:

  • (*.txt);
  • (*.mxl);
  • (*.htm, *.html);
  • (*.grs);
  • (*.geo);

During the installation process, the program registers the mxl, grs and geo extensions, as a result of which to view and edit these files, just click on them with the mouse:

It is supported to launch the program from command line. In this case, it is possible to specify the file to be processed. For example, to process the file "Remains.mxl", just run the command:

"D:\Program Files\1cv82fv\bin\1cv8fv.exe" D:\FileWorkshop\Remainings.mxl

"1C:Enterprise - Working with files" supports a mode similar to that implemented in the 1C:Enterprise system. Thus, for example, the user can visually compare two balance reports:

Delivery options

There are two delivery options for the 1C:Enterprise - Working with Files program:

  • Russian-speaking;
  • international.

The difference between international delivery and Russian-language delivery is that it includes the same ones that the 1C:Enterprise system uses.

Also, for international delivery, the /L command line switch can be used to specify the interface language to be used. For example, to process the file "Remainings.mxl" in a program with English interface (en), just run the command:

"D:\Program Files\1cv82fv\bin\1cv8fv.exe" /Len D:\FileWorkshop\Remainings.mxl

© 2024 ermake.ru -- About PC repair - Information portal