Taleo extract process add blank field in output CSV file - extract

I am using Taleo Connect Client to export data from Taleo. I encountered two questions:
How can I add blank columns to an output CSV file?
For example, try to add ColumnBlank1 between Column_FirstName and Column_LastName.
Column_FirstName|ColumnBlank1|Column_LastName
John||Lee
Adam||Jackson
How can I set default value like "N" for one field?

DBaluke Huang's answer was correct, but he left out some details. Adding the full solution for others who might need this too.
To export a blank or fixed string value in a column using TCC (Taleo Connect client) do the following:
Open your Export
Click the projections tab
Click the add button
Click Projection Function
Choose the Replace Function
Click ok
In the First Parameter Section: In the Value box, add any string field
from your list on the entity tab. The Data Type should be Field.
In the Second Parameter Section, In the Value box, add the same field
from Parameter 1 value box. The Data Type should be Field.
In the Third Parameter section, In the value box, enter no value for
blank or enter the fixed string you want in all records.
Then change the data type to string in this section.
For those unfamiliar with the replace function you are looking for the string Parameter1.Value in Parameter2.value and then replacing all instances where the string is found with parameter3.value

You can export a blank field with <quer:string/>.
<quer:projection alias="Blank" xmlns:quer="http://www.taleo.com/ws/integration/query">
<quer:string/>
</quer:projection>
Steps
Open your export in Taleo Connect Client.
Open the General tab and set the Export mode to "CSV-report".
Open the Projections tab.
Click Add.
Select Add a complex projection and click OK.
Under Complex projection, enter the following:
<quer:projection alias="Blank" xmlns:quer="http://www.taleo.com/ws/integration/query">
<quer:string/>
</quer:projection>
Save your changes.
Example:
<quer:query productCode="RC1704" model="http://www.taleo.com/ws/tee800/2009/01" projectedClass="Candidate" locale="en" mode="CSV" csvheader="true" csvdelimiter="|" largegraph="true" preventDuplicates="false" xmlns:quer="http://www.taleo.com/ws/integration/query">
<quer:subQueries/>
<quer:projections>
<quer:projection>
<quer:field path="FirstName"/>
</quer:projection>
<quer:projection alias="Blank">
<quer:string/>
</quer:projection>
<quer:projection>
<quer:field path="LastName"/>
</quer:projection>
</quer:projections>
<quer:projectionFilterings/>
<quer:filterings/>
<quer:sortings/>
<quer:sortingFilterings/>
<quer:groupings/>
<quer:joinings/>
</quer:query>
Results:
FirstName|Blank|LastName
John||Lee
Adam||Jackson
Jane||Doe
Notes:
If you get a SAX parsing error when running the export, make sure your Export mode is set to "CSV-report". (Appears as mode="CSV" in source)
When adding a complex projection in TCC, you must include xmlns:quer="http://www.taleo.com/ws/integration/query", or else TCC will call your source "invalid". However, it is not required when editing your export's source directly outside of TCC.

I resolved the issue by:
Add a function projection in Projections. Set your Alias. Set First parameter value as whatever field that available. Set the second parameter's value as same as the first parameter. Change Third parameter's value as "blank" and set Data type as String.
Same step as the first question, and set Change Third parameter's value as "N".

Related

SSIS - Loop Through Active Directory

Disclaimer: new to SSIS and Active Directory
I have a need to extract all users within a particular Active Directory (AD) domain and import them into Excel. I have followed this: https://www.itnota.com/query-ldap-in-visual-studio-ssis/ in order to create my SSIS package. My SQL is:
LDAP://DC=JOHN,DC=JANE,DC=DOE;(&(objectCategory=person)(objectClass=user)(name=a*));Name,sAMAccountName
As you know there is a 1,000 row limit when pulling from the AD. In my SQL I currently have (name=a*) to test the process and it works. I need to know how to setup a loop with variables to pull all records and import into Excel (or whatever you experts recommend). Also, how do I know what the other field names are that are available to pull?
Thanks in advance.
How do I see what's in Active Directory
Tool recommendations are off topic for the site but a tool that you can download, no install required, is AD Explorer It's a MS tool that allows you to view your domain. Highly recommend people that need to see what's in AD use something like this as it shows you your basic structure.
What's my domain controller?
Start -> Command Prompt
Type set | find /i "userdnsdomain" and look for USERDNSDOMAIN and put that value in the connect dialog and I save it because I don't want to enter this every time.
Search/Find and then look yourself up. Here I'm going to find my account by using my sAMAccountName
The search results show only one user but there could have been multiples since I did a contains relationship.
Double clicking the value in the bottom results section causes the under pane window to update with the details of the search result.
This is nice because while the right side shows all the properties associated to my account, it's also updated the left pane to navigate to the CN. In my case it's CN=Users but again, it could be something else in your specific environment.
You might discover an interesting categorization for your particular domain. At a very large client, I discovered that my target users were all under a CN
(Canonical Name, I think) so I could use that in my AD query.
There are things you'll see here that you sure would like to bring into a data flow but you won't be able to. Like the memberOf that's a complex type and there's no equivalent in the data flow data types for it. I think Integer8 is also something that didn't work.
Loop the loop
The "trick" here is that we'll need to take advantage of the
The name of the AD provider has changed since I last looked at this. In VS 2017, I see the OLE DB Provider name as "OLE DB Provider for Microsoft Directory Service"
Put in your query and you should get results back. Let that happen so the metadata is set.
An ADO.NET source does not support parameterization as the OLE DB does. However, you can apply an Expression on the Data Flow which surfaces the component and that's what we'll do.
Click out of the Data Flow and back into the Control Flow and right click on the Data Flow and select Properties. In that properties window, find Expressions and click the ellipses ... Up pops the Property Expressions Editor
Find the ADO.NET source under Property and in the Expressions section, click the Ellipses.
Here, we'll use your same source query just to prove we're doing the right things
"LDAP://DC=JOHN,DC=JANE,DC=DOE;(&(objectCategory=person)(objectClass=user)(name=" + "a" + "*));Name,sAMAccountName"
We're doing string building here so the problem we're left to solve is how we can substitute something for the "a" in the above query.
The laziest route would be to
Create an SSIS variable of type String called CurrentLetter and initialize it to a
Update the expression we just created to be "LDAP://DC=JOHN,DC=JANE,DC=DOE;(&(objectCategory=person)(objectClass=user)(name=" + #[USer::CurrentLetter] + "*));Name,sAMAccountName"
Add a Foreach Loop Container (FELC) to your Control Flow.
Configure the FELC with an enumerator of "Foreach Item Enumerator"
Click the Columns...
Click Add (this results in Column 0 with data type String) so click OK
Fill the collection with each letter of the alphabet
In the Variable Mappings tab, assign Variable User::CurrentLetter to Index 0
Click OK
Old blog posts on the matter because I like clicks
https://billfellows.blogspot.com/2011/04/active-directory-ssis-data-source.html
http://billfellows.blogspot.com/2013/11/biml-active-directory-ssis-data-source.html

JRDataset property CSV file

I have a build up a report with a .CSV input file as DataAdapter. After that I needeed a table to put some data into a it and a linked dataset. The problem is: if I leave blank the section "Default Data Adapter" in my Dataset1, no data will be displayed. In fact, to fix this report I had to export my DataAdapter as myDataAdapter.xml and then put this file in the section "Default Data Adapter" of my Dataset1 (as shown in the attached picture).
Working with database I have never set up this property.
Is there a way to pass this property as Param? (I have a java code in which I call jasperReport and I want to pass this object dinamically).
Or is there a way the report works without setting this property?
In the section Table>Dataset I have this situation:
where I set up JRDatasource expression, but it is not working...
I have one more problem. Can I set dinamically the location of my .csv inside the DataAdapter.xml?
Is it possible to implement "myDataAdapter.xml" from java code and pass it to the report??
Thank you in advance!
In Java code you can set properties on the net.sf.jasperreports.engine.JasperReport instance like in this sample here, from the official repository. The relevant code looks like this:
...
JasperReport jasperReport = ...
...
jasperReport = (JasperReport)JRLoader.loadObjectFromFile("build/reports/ExcelXlsxQeDataAdapterReport.jasper");
jasperReport.setProperty(DataAdapterParameterContributorFactory.PROPERTY_DATA_ADAPTER_LOCATION, "data/XlsxQeDataAdapter.xml");
...
The property of interest is net.sf.jasperreports.data.adapter and is stored in DataAdapterParameterContributorFactory.PROPERTY_DATA_ADAPTER_LOCATION
The data adapter file is a convenience method to pass a series of parameters from which a net.sf.jasperreports.engine.data.JRCsvDataSource is built. If you want to skip passing this property, you would have to manually provide the built-in parameters listed in the net.sf.jasperreports.engine.query.JRCsvQueryExecuterFactory.CSV_BUILTIN_PARAMETERS.

SSIS Flat File Connection - How does it determine string column DataType?

I am creating a new Flat File Connection Manager SSIS component which is based on a CSV file. I am keen to have the columns (all 547 of them) to be of type Unicode string [DT_WSTR] rather than string [DT_STR].
I am not sure how to trigger this component to do this automatically.
I guess I could go through and manually change each every one of the 547 columns to this data type of Unicode string [DT_WSTR]
Any comments or answers much appreciated !
I have tried using the Unicode checkbox but the wizard then doesn't find the columns. I get message "The specified header or data row delimiter "{LF}" is not found after scanning 2097152 bytes .."
I was hoping there would be some way of changing all the column data types in one action without having to make 547 column type changes.
You can simply open the Flat File Connection Manager, Go To Advanced Tab, Click on one Column, Hold Ctrl key and select all columns then change the data type to DT_WSTR.
Additional information can be found in the following link:
SSIS: Flat File default length
I found an answer to this question.
https://social.msdn.microsoft.com/Forums/en-US/747ad564-1add-422e-af3c-9375b130ec83/easy-way-to-set-all-data-types-in-a-connection-manager?forum=sqlintegrationservices
i.e. In the Flat File Connection Manager Editor it is possible to select multiple (or all) the columns and then the DataType choice made is applied to all the selected columns.
Phew !
i.e. like this:

SSIS how handle var length in Derived column to avoid truncation

I have this setup like in illustration attached, hope it clear enough. I load all xls files in loop from given folder.
While implementing new Derived Column box to record FileName from my loop I got truncation error. My variable initially was set to CCS.xls (Len=7, shortest name ).
I tried to increase Length in Derived Column Editor but failed to do this, as it's not active, I can't not type anything there, then I track that that original Length came from Variables value. In Variable windows I have DataType = String and no any option to set length.
So for now I made dummy empty file with looong CCS____1.xls name to avoid this problem and it works OK. But want to learn other good way to avoid this problem, looks like in this setup for data connection I need to use file with longest name (?)
You can change the Length property to 50 or larger manually in Advanced Editor.
Right-Click on the Derived column->Show Advanced Editor->Input and Output Properties->Derived Column Output->Output Columns->the new Column->Data Type Properties->Length

Use a value from a combo/text box in a file path string

I have a form that I intend to allow users to browse powerpoint presentations through, because there are a lot of different briefs for metrics, which is what I use this database for. So, I already know how to set up everything, just got one little hang up.
If I place a combo box on the form to select from a list of different presentation, can I use that in the file path string (that I have to use to pull the ppt into theobject frame in access.
example:
"C:\Users\Justin\Desktop\" & cmbTitle & ".ppt"
I tried it and it gives me the error message variable not defined. I never defined a control before on in these things, would it be as a string?
I realize that the exact file path much match the entered value. Access 2000-2003/XP
Thanks as always guys!
You need to refer to the field as Me.cmbTitle. As it is written, it looks like you're calling the variable cmbTitle which doesn't exist.
Is the value of cmbTitle some ID/Integer field or is it the actual string value? You may want to use the immediate window to check this. Also, make sure the value of cmbTitle doesn't have any backslashes or spaces (That may require quotes?).
I'm somewhat confused as to what you're trying to do. I will write my answer assuming:
you have a form in an Access database.
on that form is combo box that lists the PowerPoint presentations your users are working with.
the bound column of the combo box lists the filename (without path) of each PPT file.
when the user selects a filename from the combo box, you want to display it in an unbound OLE object frame.
The code for that, assuming the list of PPT files is called cmbTitle, would be in the combo box's AfterUpdate event and would look like this:
Private Sub cmbTitle_AfterUpdate()
Dim strPresentation As String
If IsNull(Me!cmbTitle) Then Exit Sub
strPresentation = "C:\Users\Justin\Desktop\" & Me!cmbTitle & ".ppt"
Me!olePPT.SourceDoc = strPresentation
End Sub
Now, I can't get a test unbound OLE object frame to work with this, but it seems to me to be the right way to do it.
My suspicion is that you're either attempting to set the wrong property, or you've defined your OLE frame wrongly, but I can't offer any more advice on that without knowing more about what you're actually attempting to do, and exactly what line of code is causing the error.