IMPORTRANGE function to pull data from the copied sheet, not the original sheet - google-sheets-formula

I am using the IMPORTRANGE function in Google sheets to draw data from different tabs.
I have made copies of the original sheet, and those copies are circulated among people who can independently make changes and updated their data.
But the IMPORTRANGE function in every copied sheet contains the url link of tabs that are in the original sheet. So when the people are making changes in their copied sheets, their changes aren't reflected in their versions.
But the changes in the original sheet are reflecting in every copied sheet since all of them contain the url link of the original sheet.
Is there any way I can make this dynamic so that the url would always be that of the sheet they are using?
It would take a lot to change every url link, since there are several copies.
Any suggestion would be appreciated.
Thanks in advance!
I have put the url link in individual cells and tried to put cell references in place of the url.
Like this:
=IMPORTANGE("A1","Sheet1!B1:B")

Related

How can I switch sheet focus in Numbers using JXA?

I am working on a JXA script that will be used to copy tables from an existing Numbers sheet, and then paste them into a newly created sheet (in the same document) before making some modifications to individual cell values. I have most of what I need working, but have been unable to figure out how to change the active sheet from the source sheet to the destination sheet (or any sheet).
I have tried the following;
Numbers.documents[0].sheets.byName({name: currentSheet}).activate
It seems to execute (there are no errors), but nothing happens in Numbers. The active sheet does not change. I have the script working in AppleScript using
set active sheet to sheet currentSheet
Any help is appreciated.
I hope this help.
var numbersApp = Application("Numbers");
var docNumbers = numbersApp.documents[0]
// First sheet
docNumbers.activeSheet.set(docNumbers.sheets[0])
// Using sheet name
docNumbers.activeSheet.set(docNumbers.sheets["sheetName"])

Export data from a list view using a button

I am building a simple admin-on-rest application. One of the features is the user to export the content from a list view. So far I have two possible approaches in mind.
Export based on the selected filters (my favorite).
Export based on the selected rows from the table using check boxes.
I guess two things are necessary to achieve that:
Be able to render a button somewhere in "list view": would be great to add an "export" button inside the "filters" section. I couldn't find a way to render an "export" button keeping the filters.
That "export" button would be able to get the filters (from the list view filter section) for creating my custom URL for downloading the data. Or if using check boxes, detect the selected rows from the table and export that data.
I have been looking for examples or following other colleagues questions and I coundn't come up with anything similar. Any info/example/project will be much appreciated.
This is quite solvable. The filter is stored in the redux form and can be accessed by any connected component. I am guessing you have an API endpoint available that you can ping with the filter data and that can then generate the file and respond with the file URL.
1) Write a connected button component. This should have a mapStateToProps method to access the current filter data
https://marmelab.com/admin-on-rest/List.html#actions
2) It should also dispatch an action that generates a POST request.
https://marmelab.com/admin-on-rest/Actions.html#using-a-custom-action-creator
IMPORTANTLY: You will have to think about how the file itself will get downloaded. Since you are generating the URL on the fly, it will not be embedded in the model data so you do not have access to it. You might have to hard code a file name and path into your components so clicking will always lead to a download. Though this is not as trivial as it sounds, as the file generation itself will be an async operation. I think clicking this button should lead to a redirect to a page where the download link is displayed.
Just to complement krunal's answer, there's a library called FileSaver that can take a json response and start a file save operation with its content, showing a file save dialog, or even download it directly to a file of your choice.

How do I repeat images and textboxes as headers for each report sheet in SSRS

I have multiple datasets that I am binding to individual tablixes in order to render them as individual Excel workbook sheets. However, I need the header elements that are visible on the very first sheet, to be repeated on all of the other sheets, in exactly the same format and position. How will I go about doing this please?
Containing all the elements within a rectangle element solved the issue.
Simply place them wherever you'd like to see them; there may exist a more elegant approach but this has always worked for me, just remember to add a page break before every header and ensure there is no "blank"spacing between sheets.

jqGrid issue - getRowData

I seem to be havign yet another problem with jqGrid :-( I am trying to get the current row data using getRowData, but all I get back is an array [object, Object]. What am I doing wrong?
This is what I'm using
var rowdata = $("#list").jqGrid('getRowData');
Can somebody help?
thanks
After reading in the comments additional information about your problem I would recommend you following.
If you need to print the page which contains jqGrid you could need to prepare additional CSS for media="print". See here for additional information.
The method getRowData called without parameters give back the array of rows which are array of visible cells. For every cell will be called unformatter, so the data could be not identical to to data which you posted to jqGrid. Moreover if you use data paging or filtering you can have another problem: only visible cells from the current page will be returned back.
I personally prefer to use export to Excel instead of printing the pages. In the case I add an custom button in the navigator bar. If the button will be clicked by the user the request to the corresponding MVC controller action will be sent. The server get all data for the corresponding grid from the database and generate XLSX Excel data as stream with respect of Open XML SDK. The corresponding code is not very small, but in the way one can generate perfect Excel file formatted like it is required. In the case you don't need install Microsoft Office on the server side. The user just opens Excel with all data if he/she clicks the "Export to Excel" button in the jqGrid. In Excel there are very good printing possibility. The most users knows Excel very good and can customize the data (hide some columns for example) before printing.
So my suggestion to you to spend some time in implementing export to Excel instead of implementing printing of jqGrid directly.

Save Silverlight DataGrid sort

I have a Silverlight 2.0 DataGrid that contains a list of items that needs to be refreshed in an interval to display the up-to-the-minute information. There are items in this grid that may be added and may be removed while the screen is being displayed to the current user. For Example:
If grid looks like the following, then after a minute the data needs to be refreshed because another user has added a 4th entry. (notice the sort is assending by Last Name)
Data Grid http://img16.imageshack.us/img16/1667/datagrid.jpg
Then when I get the new data set and set it to the datagrid's DataSource property, it resorts the array based on my first column like so:
Data Grid2 http://img19.imageshack.us/img19/1294/datagridb.jpg
Is there any way to reapply the sort after the data source has been updated? I'd like to save the fact that the data grid is sorted by last name, then update the data source, and then reapply the sort to the data grid. So, in the end the datagrid would look like the following:
Data Grid3 http://img13.imageshack.us/img13/4636/datagrid2.jpg
These screen shots are of course not a Silverlight data grid, but this is for simplicity in explaining the situation.
Probably the best way to go about it is to use PagedCollectionViews, although I have not tested this out myself, these classes contain a property that stores the different sorting methods applied to them. I believe that you can probably grab the current sorting element from one collection, connect to the new collection, and apply the sorting to the new collection.
For a more in depth discussion on how this all works, you can follow the explanation here
I tried using PagedCollectionViews as well as CollectionViewSources (I used the new collection to overwrite the existing source collection).
My solution isn't the most elegant, but it works. When updating the source of the DataGrid I did my own change detection.
In other words, instead of blindly overwriting the source collection I iterated through the new collection, compared each item to the existing collection, and updated the existing items where possible.
Hope that helps.
After researching how to do this, I have figured it out. I tried to implement what the others said to try, but could not get it to work in Silverlight 2.0. Thus, I searched StackOverflow and Google for more answers. ScottLogic and CodeProject seemed to be what I was looking for but I couldn't get them to work fully. So with a bit of frustration and playing around with code, I finally arrived on the solution.
If the collection that you're using for your DataGrid's ItemsSource is ObservableCollection(Of T), you can get the ability of sorting for the object, plus you can update the collection dynamically at runtime, causing the grid to refresh with the item you insert. I've created a Google Code project that is GPL for you to checkout and download. Please note that I'm using the Microsoft Silverlight 2.0 DataGrid December 2008 Release for this project. I have linked to this download on the project page as well. (The dll's required are referenced from within a lib folder inside the project).
Enjoy!
Silverlight 2.0 DataGrid Sort Project on Google Code

Resources