Microsoft Access - Multiple Items Form Image - image

I have 2 tables: One of them is named 'ImageDrive', and the other is named 'Person'. In the Person table, there is a field called 'Primary Image Path' and it stores part of the path, i.e., "\DefaultPicture\default.jpg". The ImageDrive table has a field Drive which stores "C:\MyDocuments\Pictures".
I created a Person form, with a form type of "multiple items form". I then removed the textbox and replaced it with an image control for the Primary Image Path field.
Now the problem is, how do I go about extracting the information from the Drive field in ImageDrive and combining it with the Primary Image path? I need to combine them in order to set the Image control picture.
I have tried using Expression Builder and came up with the expression [ImageDrive]![Drive]&[Primary Image Drive] for the image control source. However, when I click on Form View, it shows nothing.
What is the right way to do this?

I'm not sure if you wanted to do this in VBA or not, but here is a small bit of code that may help for getting the path of that user. You can combine that with a Recordset to reference your other table of pictures. Or use two recordsets, one for each table.
Dim myR as Recordset
Dim myR2 as Recordset
Dim filePath as String
Set myR = CurrentDb.OpenRecordset("ImageDrive", dbOpenDyanset)
Set myR2 = CurrentDB.OpenRecorset("Person", dbOpenDynaset)
'When you open these two Recordsets they will open on the first record of each FYI
'You can either use myR.FindFirst or a Select statment to sort through the records
filePath = myR![Field_name_of_path] & myR2![Field_name_from_other_table]
'Now filePath contains what you need.
'You can also use Environ$("USERPROFILE") & "\My Documents"
'to get something like C:\username\My Documents and set that as a string as well
Set myR = Nothing
Set myR2 = Nothing

After including the image control, go to the control source of the image control. and using the dlookup method to get the drive, as the form is created by using the fields the Person table. Below will be the line of code to be put at the control source.
"=DLookUp("[Drive]","ImageDrive","[Drive] IS NOT NULL") & [Primary Image Path]"

Related

How to read an excel sheet and put the cell value within different text fields through UiPath?

How to read an excel sheet and put the cell value within different text fields through UiPath?
I have a excel sheet as follows:
I have read the excel contents and to iterate over the contents later I have stored the contents in a Output Data Table as follows:
Read Range - Output:
DataTable: CVdatatable
Output Data Table
DataTable: CVdatatable
Text: opCVdatatable
Screenshot:
Finally, I want to read the text opCVdatatable in a iteration and write them into text fields. So in the desired Input fileds I mentioned opCVdatatable or opCVdatatable+ "[k(enter)]" as required.
Screenshot:
But UiPath seems to start from the begining of the Output Data Table whenever I called for opCVdatatable.
Inshort, each desired Input fileds are iteratively getting filled up by all the data with the data stored in the Output Data Table.
Can someone help me out please?
My first recommendation is to use Workbook: Read range activity to read data from Excel because it is quicker, works in the background, and does not require excel to be installed on the system.
Start your sequence like this (note the add headers property is not checked):
You do not need to use Output Data Table because this activity outputs a string containing all row items. What you want to do instead is to access the items in the data table and output each one as a string in your type into, e.g., CVDatatable.Rows(0).Item(0).ToString, like so:
You mention you want to read the text opCVdatatable in an iteration and write them into text fields. This is a little bit more complex, but i'll give you an example. You can use a For Each Row activity and loop through each row in CVDatatable, setting the index property if required. See below:
The challenge is to get the selector correct here and make it dynamic, so that it targets a different text field per iteration. The selector for the type into activity will depend on the system you are targeting, but here is an example:
And the selector for this:
Also, here is a working XAML file for you to test.
Hope this helps.
Chris
Here's a different, more general approach. Instead of including the target in the process itself, the Excel would be modified to include parts of a selector:
Note that column B now contains an identifier, and this ID depends on the application you will be working with. For example, here's my sample app looks like. As you can see, the first text box has an id of 585, the second one is 586, and so on (note that you can work with any kind of identifier including the control's name if exposed to UiPath):
Now, instead of adding multiple Type Into elements to your workflow, you would add just a single one, loop over each of the datatable's row, and then create a dynamic selector:
In my case the selector for the Type Into activity looks as follows:
"<wnd cls='#32770' title='General' /><wnd ctrlid='" + row(1).ToString() + "' />"
This will allow you to maintain the process from the Excel sheet alone - if there's a new field that needs to be mapped, just add it to your sheet. No changes to the Workflow are required.

Crystal Report not filtering SQL records based on selection formula

unfortunately I'm not an expert of Crystal Report, so I'll post here my question hoping for any help about my issue.
I want to display inside my report the result of a filter on a SQL RecordSet; this RecordSet is looked up from an a single table, of which I want to show some fields of my SQL table, while the filter I want to apply is based on a field parameter (defined static) that I'm trying to set programmatically.
Here below I attached my code where I'm applying the record selection formula, I tried also hard-coding the value instead of passing it through a dropdown selection:
ReportDocument RPT_Doc = new ReportDocument();
RPT_Doc.Load(RPT_Path_Name, OpenReportMethod.OpenReportByDefault);
ApplyConnInfos(ref RPT_Doc);
RPT_Doc.SetParameterValue("data_riferimento", "20161001");
RPT_Doc.RecordSelectionFormula = "{viaggi.data_part_pre} = '20161001'";
crystalReportViewer1.ReportSource = RPT_Doc;
In the first image attached you can find the field parameter definition, while second image is the record selection formula I defined inside my report:
The report always shows all the records of my table (more than ten thousand rows), instead of displaying a filtered RecordSet. The odd thing is Preview function from Visual Studio works like a charm; it prompts the field value, once I confirm the value the viewer displays the report with the rows filtered as I expect..
What am I missing from report/C# program configuration to make the record selection work?
Thank you in advance for any suggestion you can give me :)
Leonardo
Ok, finally we got the solution to our issue.
We found the CrystalReportViewer object used to display generated reports has 2 different properties, SelectionFormula and ViewTimeSelectionFormula; both has default value set to empty string.
Below I attached the picture of .Designer.cs file with the 2 properties valued:
We commented those 2 properties and the selection formulas and field parameters applied through code / report designer worked again.

Trying to keep data from moving down in grouped report

I'm trying to create a report which shows a list of all companies and all jobs awarded for that company. I have the company name at the top of the group with a total at the bottom-inside of the group. I also have address information for the companies which I am trying to keep directly under the company name. The address data keeps moving down. How can I keep the data up directly under the company name.
As you can see from the image above. I want the address information moved up directly below the company name. Below is what my design view looks like.
If you can do a screenshot of the report in design that would help. My guess is you have to work with the "insert row outside group above" while having the company row group selected. Then put your address in the right row.
The other way I have seen is to put the address and company and text all together in one output line in the SQL and use Char(10) + Char(13) to put in the line breaks.
Had to add a new line in an expression.
=Fields!Company_Name.Value & vbcrlf & Fields!Address.Value & vbcrlf & Fields!Province.Value

Magmi Not Importing When CSV Files Contains Commas

I have installed and made some successful product imports in to Magento using Magmi, but as soon as I try to import any data where the spreedsheet columns have commas [,] Magmi will not perform the import.
For example when I save the data in this speadsheet as a CSV file Magmi successfully imports the data;
http://i.imgur.com/PpDt0PS.png
However, Magmi refuses to import the data in the table below, where you can see in column F I have added data that include 'commas'.
http://i.imgur.com/MtGJPCw.png
Can anyone advise. I am using an Apple Mac with OpenOffice to prepare and save my data.
Is the data not importing entirely, or is just the visibility column not being set?
Visibility is a Magento core attribute which Magmi can set by using exact numerical option id value.
Generally, the option values you want to use for the visibility field are as follows:
Not Visible Individually = 1
Catalog = 2
Search = 3
Catalog, Search = 4
So in your case, if you want to set these products to Catalog, Search, you can set the visibility column value to 4.
To double-check that the above mapping is correct for your instance of Magento, the easiest way is as follows:
Go edit any product
Look for the Visibility drop down field, and right click > inspect element
In the developer tools, take note the values associated to each label.
Below an example of the process and what to look for.
Axel is correct, you should set the data to the numerical value 4.
But I do also recommend you explore a better way to export CSV content from Open Office. You may have to start a new document because I find I only see the dialogue below once and then I never see it again. Create a new document, paste your data into it. Choose save-as, select CSV, and save it. Eventually you should see the dialogue below. Change the encoding to UTF 8, the text delimiter to " and tick the 'Quote all text cells' box.
Then you should be able to have any cells with commas or other things in them. Always ensure you CSV files are quoted. "like","this","so you, can","have commas, in them". It is worth inspecting your CSV file in a text editor to see the format is as expected before uploading it to MAGMI.

Use value of form control in a new record

Microsoft Access 2013 form with a value named FullSiteData built from this expression:
="50" & "-" & [IslandCode] & "-" & [QuadData] & "-" & [SiteData]
where IslandCode is a combobox and QuadData and SiteData are validated textboxes.
My question is how do I save the result of the expression into the Access table?
A textbox with data Control Source linked to the table field works, but I'd like to use the result of the expression builder instead.
I've built some web forms using PHP and MySQL and understand the process of a query adding data to a table, but don't really understand what Access is doing. Should I be looking at using the event properties?
If this is a matter of just adding new records to the database then you could use a Text Box bound to [FullSiteData] and have the After Update events of the controls for the constituent parts (Combo Box and two Text Boxes) update the .Value of the [FullSiteData] Text Box. When the record is saved that .Value will be written to the [FullSiteData] field.
If you will also be editing existing records then things get more messy because in the On Current event you'd have to split the existing [FullSiteData] into its parts and then set the values of the other controls to match. (Not so bad for the Text Boxes, but doing that for the Combo Box could be a bit of a nuisance.)
If the latter is a possibility then I recommend that you "bite the bullet", split the existing [FullSiteData] values into separate fields, and save those fields separately. Then you could convert [FullSiteData] to a Calculated field in the table (using the expression in your question) to minimize the impact on existing reports, etc.. (My guess is that most of them probably won't even notice...)

Resources