Reporting On Custom Issues Fields project Server 2010

I have created a few new issue content types - wishing to create a customised Issues list for the site. I was wary of going near the default "Issue Status", "priority" or "category" fields, as several discussions here warned
against meddling with them. Whilst the issues creation process seems to work fine, I cannot see where i can retreive the data from these new fields in the SQL tables - they are not visible on the MSP_WSSIssueOlapView table. Where can I find these fields?

On top of what have been said, which are all good comments, I wish to add that obtaining fields from WSS_Content is not straight forward as you will need to look into the AllUserData table and identify which fields correspond to which Issues List columns.
This is because text columns (e.g. Issue Title) will be stored as nvarchar1, nvarchar2, date columns (e.g. Resolution Date) will be datetime1, datetime2 and so on. Date fields are stored in UTC time so you will need to add your local time offset to it. If
you need  to obtain the names of Issue Owner and Assignee you need also to link to the AllUserInfo table to get them. As an example, below is a sample SQL statement that I used for one of my reports:
SELECT MSP_EpmProject_UserView.ProjectName, PWS.[Issue Title], PWS.Status, PWS.Priority, PWS.Category,
PWS.[Resolution Due Date], PWS.[Issue Owner], PWS.[Created Date], PWS.[Assign To]
FROM MSP_EpmProject_UserView INNER JOIN
(SELECT WSS_Content.dbo.Webs.FullUrl, CASE WHEN WSS_Content.dbo.AllUserData.nvarchar1 IS NULL
THEN WSS_Content.dbo.AllUserData.nvarchar11 ELSE WSS_Content.dbo.AllUserData.nvarchar1 END AS [Issue Title],
WSS_Content.dbo.AllUserData.nvarchar3 AS Status, WSS_Content.dbo.AllUserData.nvarchar5 AS Priority,
WSS_Content.dbo.AllUserData.nvarchar4 AS Category, DATEADD(hh, 8,
WSS_Content.dbo.AllUserData.datetime4) AS [Resolution Due Date], DATEADD(hh, 8, WSS_Content.dbo.AllUserData.tp_Created)
AS [Created Date], WSS_Content.dbo.UserInfo.tp_Title AS [Issue Owner], UserInfo_1.tp_Title AS [Assign To]
FROM WSS_Content.dbo.AllUserData INNER JOIN
WSS_Content.dbo.AllLists ON WSS_Content.dbo.AllUserData.tp_ListId = WSS_Content.dbo.AllLists.tp_ID INNER JOIN
WSS_Content.dbo.Webs ON WSS_Content.dbo.AllUserData.tp_SiteId = WSS_Content.dbo.Webs.SiteId AND
WSS_Content.dbo.AllLists.tp_WebId = WSS_Content.dbo.Webs.Id LEFT OUTER JOIN
WSS_Content.dbo.UserInfo ON WSS_Content.dbo.AllUserData.int3 = WSS_Content.dbo.UserInfo.tp_ID AND
WSS_Content.dbo.AllUserData.tp_SiteId = WSS_Content.dbo.UserInfo.tp_SiteID LEFT OUTER JOIN
WSS_Content.dbo.UserInfo AS UserInfo_1 ON WSS_Content.dbo.AllUserData.int2 = UserInfo_1.tp_ID AND
WSS_Content.dbo.AllUserData.tp_SiteId = UserInfo_1.tp_SiteID
WHERE (WSS_Content.dbo.AllLists.tp_Title = 'Issues') AND (WSS_Content.dbo.AllUserData.tp_IsCurrent = 1) AND
(WSS_Content.dbo.AllUserData.tp_DeleteTransactionId = 0) AND (WSS_Content.dbo.AllUserData.tp_RowOrdinal = 0)) AS PWS ON
PWS.FullUrl = RIGHT(MSP_EpmProject_UserView.ProjectWorkspaceInternalHRef, LEN(PWS.FullUrl)) COLLATE DATABASE_DEFAULT
Hope this helps.
KH

Similar Messages

  • Create a Custom View in Project Server 2010 that is Visible in MS Project

    Hello All,
    We want our PMs to consistently report Physical % Complete, but couldn't find an existing "Status" or "EVM" view.  So, in Project Server 2010, using Server Settings > Look and Feel > Manage Views, I created a customized project
    view using existing fields (no customized fields, if that matters).  The problem is that I cannot find the view when I open MS Project.  Under Manage Views, in the Format View section, I have selected "Gantt Chart (Views)" for the Gantt
    Chart format field.  The view defaulted to "Timesheet" for the Grouping format field.  Under the Security Categories section, I have selected My Projects and My Tasks.  I have not applied a Filter.  Any ideas why I cannot find
    this new custom view in MS Project?  
    Was I supposed to create the new customized view directly in MS Project?  If so, where would I find the steps to do that?  Thank you!
    Julie

    Julie --
    Nice try, my friend.  Your only mistake was trying to create the Microsoft Project view in PWA.  You have to open the Enterprise Global for editing in Microsoft Project, and then create the custom view and table in the Enterprise Global. To
    open the Enterprise Global for editing, click File > Info > Manage Enterprise Global.  When you finish creating the custom view and table, then save, close, and check in the Enterprise Global file, and then exit Microsoft Project completely.
    The next time you or any of your PMs launch Microsoft Project and connect to Project Server, the custom view and table will be visible for every current and future project.  Hope this helps.
    Dale A. Howard [MVP]

  • Project Server 2010: PWA Removing Default Project Site Security Groups When Creating a New Project

    I looked for this specific issue with Project Server 2010/PWA/SharePoint and could not find an exact answer... hopefully someone can help.
    We are currently using Project Server 2010 and have a number of project site templates that are used dependent upon the enterprise project type selected. Each of these project site templates have unique permissions which should create the default security
    groups on the project site upon publishing/syncing:
    <Project Name> Members
    <Project Name> Owners
    <Project Name> Visitors
    <Project Name> Project Managers (Project Web App Synchronized)
    <Project Name> Team Members (Project Web App Synchronized)
    Web Administrators (Project Web App Synchronized)
    Whether a user creates a project through PWA or Project Pro 2010 and imports the project into PWA, we get a weird result in the Site Permissions of the newly created project site. PWA will remove all default security groups from the project site template
    and add a whole list of users in the Site Permissions list without groups. 
    Once the project is published and the project site is created, we can then go back and add those default security groups back in the project Site Permissions and even add a couple of custom groups without them being removed on all subsequent project syncs
    or publishing. 
    How do we get PWA to not overwrite the project site templates' security groups and place each user in the proper default security groups? At the same time, how is PWA adding a number of users into the Project Site Permissions?
    Thanks in advance.

    Paul,
    Thanks for that information. Right now we are using the Test environment to turn the Auto-sync feature back on. I suspect that the reason this is happening is due to PWA groups/categories/security templates. There may be more than one PWA group that is "overwriting"
    the default project site groups upon initial creation of the project. We will look further into the security settings to tighten up the policies. 

  • Project server 2010 What are the number of Custom fields and views allowed?

    How many customizations are permitted in Project Server 2010?
    Thanks in advance

    Hi
    new findings on that issue...
    There is an article for Project Online that speaks about limits for reporting: https://support.office.com/en-US/Article/Project-Online-software-boundaries-and-limits-5a09dbce-1e68-4a7b-b099-d5f1b21ba489?ui=en-US&rs=en-US&ad=US
    Apart from that you will have an issue if you like to upgrade to Project Server 2013. When trying to convert the 2010 databases to a 2013 database a SQL stored procedure will fail if you have more custom fields than fit into the UserViews.
    Error message will be something like this:
    System.Data.SqlClient.SqlException (0x80131904): INIT METADATA ERROR!  At least one mismatch found between SQL schema for view MSP_EpmProject_UserView and reporting metadata.  Call to MSP_Epm_CheckIntrinsicAttributes failed for Projects  INIT
    METADATA ERROR.    
     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)    
     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)    
     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)    
     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)    
     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)    
     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)    
     at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)    
     at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()    
     at Microsoft.Office.Project.Server.Data.SqlSession.ExecuteNonQuery(SqlCommand command)  ClientConnectionId:21f11abd-7388-48a0-a029-b5161fcb2dc8
    Workaround for the issue (UNSUPPORTED !!!!!!)
    Execute the Convertto-SPProjectDatabase script. Now you need to be fast or well prepared. You need to find the MSP_Epm_CheckIntrinsicAttributes stored procedure. Execute an ALTER statement for it and change the last lines of code to something like this:
    LblError:
       PRINT @ErrorMessage
        --changed RETURN code if an error occurs to be able to proceed with migration 
        --RETURN 1
         RETURN 0
    END
    I hope that helps someone out there - when I came across the issue last night, a google query returned nothing for INIT METADATA ERROR....
    Regards
    Christoph
    Christoph Muelder | Senior Consultant, MCTS, MCSE | SOLVIN information management GmbH, Germany

  • How to find Project Level Text Custom Fields in Project Server 2010 databases?

    Hello,
    We are using Project Server 2010 SP2 in SEM Mode. We are planning to use Project Level Local Custom fields and we want to pull them in reports using SSRS, so I am wondering which table these "Local" (non enterprise) custom fields are stored in
    database.
    Any suggestions?
    Regards,
    Kishore Dodda
    Kishore Dodda

    Hi,
    Please see this
    similar thread about reading local custom fields though the PSI.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Issue in Custom Filter in PWA of Ms Project Server 2010

    Hi,
    i am facing an issue on setting a cutom filter in the Project Center view of PWA. I am setting a custom filter and it works fine.
    Projects are filtered as per the filter. However, on selecting the filter for editing, I get a message viz. "Failure. There was an error processing the request".
    I am looking for pointers and guidance to resolve this issue. Any helpin this regard will be appreciated.

    Hi,
    Evenif you already checked this out, it is likely to be a security issue. This functionality is managed by permissions in PWA server settings and not in the Central Admin.
    Check this article :
    http://msprojectnow.com/Blog/tabid/142/entryid/556/Enabling-Task-Sheet-functionality-to-Add-Yourself-to-a-Task-in-Project-Server-2010-PWA.aspx
    Check if you're not belonging to multiple categories that might have the given permission disabled.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • How to define a unique project level custom field in project server 2010?

    Hi every one;
    is it possible to define a unique project level custom field?
    our client wants to have a unique custom field( project code) which doesn't allow users to save and publish projects with the same value.
    for example if user A define a project and set "project code = 1" if user B define another project and wants to save "project code =1" for it, the server doesn't allow him to save this value and he has to change value for example to 2
    thanks for any help

    First of all you need to have Project server development environment also for coding visual studio hands on is required.
    To start with PSI (Project Server interface)you need to have Development Environment of Project Server 2010.
    you can get the overview from http://msdn.microsoft.com/en-us/library/office/ms457477(v=office.14).asp
    You
    can get the information about SDK: Download SDK.
    http://msdn.microsoft.com/en-us/library/office/ms512767(v=office.14).aspx
    Below mentioned link is having code and reuqired information about :
    Generate Unique ID for Project using a webpart
     http://epmxperts.wordpress.com/2012/05/21/generate-unique-id-for-project-using-a-webpart/

  • Delete Enterprise Custom Fields in Project Server 2010

    Hello,
    We have Project Server 2010, SP2, in SEM mode. We recently removed some legacy unused Project Level enterprize custom fields from system, and observed that, the fields are not visible via PWA System Settings, but still see them in Project Pro, Project Information
    dialog and also available as a field that I can add it to a view.
    I have already tried following:
    - Clear the roaming profile (global.mpt) and exit out of Project Pro, and reconnect to Project Server... but still see those fields.
    Any ideas, why we see it, and is there any additional steps we need to perfome to remove from Project Pro?
    Please suggest.
    Regards,
    Kishore Dodda
    Kishore Dodda

    Hello,
    They should have removed automatically. I have seen this before and carried out these steps:
    http://pwmather.wordpress.com/2012/02/22/projectserver-2010-msproject-enterprise-global-custom-fields-out-of-synch-ps2010-ps2007/
    Fully backup the system before doing this and test on a DEV / Test system first.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • How to set a default date for a custom field of Date type in project server 2010.

    hi,
    can somebody help  me.
    How Can i set the default date for a custom field of date type in project server 2010 ?

    Dear Rohan,
    You can set default value to custom field thru Lookup table. Assign lookup table to custom field and set default value to some lookup value (Note: check the “Choose a value to use as a default when adding new item” checkbox).
    Regards,
    Avinash kumar | Blog:http://avigr8.wordpress.com | If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.

  • Updating custom fields in project server 2010/2013 using psi

    Hi,
    I have two custom fields . Lets call them A and B.
    A has some content. Now i want B to have the same content as A . B is a formula custom field wher b=[A] .
    now b is empty data and A has data.
    how do i get column in B be populated.
    i tried manual publish. IT worked but i have several projects.so iam looking for a script to do bulk publish so that data in B can be populated with data in A
    a) i checked out project (CheckOutProject)
    b) published project (QueuePublish())
    c) checked in project (QueueCheckInProject())
    however i donot get the value of A reflected in B using. Am i doing something wrong?
    Pls help.Any pointers towards a script would behighly appreciated.
    i am using project server 2010
    Thanks
    Su

    Hello,
    You probably want to use Project Pro to do the publish so the calculation happens and updates field B. For bulk publish using project pro use VBA to automate project pro to open each project then do save and publish etc.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS |
    MVP | Downloads

  • How to Edit Custom Fields of Project Server 2010 Programatically

    Hello,
    I want to change the Custom field value of Project Server 2010. I am following the brain article. My problem is the code run successfully but the changes did not reflect to the Project server. Following is my code, Any Help??
    private void UpdateRecordInProjectServer(string newValue, string projGuid, string propertyToEdit)
                ProjectSoapClient projectSvc = new ProjectSoapClient();
                CustomFieldsSoapClient customfieldSvc = new CustomFieldsSoapClient();
                CustomFieldDataSet fieldDefs = customfieldSvc.ReadCustomFields(string.Empty, false);
                LookupTableSoapClient loockuptableSvc = new LookupTableSoapClient();
                Guid projectId = new Guid(projGuid);
                ProjectDataSet projectDs = projectSvc.ReadProject(projectId, ListProjects.Project.DataStoreEnum.WorkingStore);
                foreach (ProjectDataSet.ProjectCustomFieldsRow cfRow in projectDs.ProjectCustomFields.Rows)
                   // projectDs.ProjectCustomFields.RemoveProjectCustomFieldsRow(cfRow);
                    CustomFieldDataSet.CustomFieldsRow fieldDefinition = fieldDefs.CustomFields.Single(
                            cfd => cfd.MD_PROP_UID == cfRow.MD_PROP_UID);
                    if (fieldDefinition.MD_PROP_NAME == propertyToEdit)
                        cfRow.TEXT_VALUE = newValue;
                    //projectDs.ProjectCustomFields.AddProjectCustomFieldsRow(cfRow);
                    projectDs.ProjectCustomFields.AcceptChanges();
                Guid sessionUid = Guid.NewGuid();
                Guid jobUid = Guid.NewGuid();
                if (!IsProjectCheckedOut(projectId))
                    projectSvc.CheckOutProject(projectId, sessionUid, "Updating
    CF");
                    jobUid = Guid.NewGuid();
                    projectSvc.QueueUpdateProject(jobUid, sessionUid, projectDs, false);
                    System.Threading.Thread.Sleep(4000);
                jobUid = Guid.NewGuid();
                projectSvc.QueueCheckInProject(jobUid, projectId, false, sessionUid, "Updating
    CF");
                System.Threading.Thread.Sleep(4000);
                jobUid = Guid.NewGuid();
                projectSvc.QueuePublish(jobUid, projectId, true, SPContext.Current.Site.Url);
                System.Threading.Thread.Sleep(4000);
    Muhammad Ali

    Try this instead of your last section(after last "if" statement):
    jobUid = Guid.NewGuid();
                projectSvc.CheckOutProject(projectId,
    sessionUid, "Updating CF");
                System.Threading.Thread.Sleep(4000);
                projectSvc.QueueUpdateProject(jobUid, sessionUid,
    projectDs, false); 
    System.Threading.Thread.Sleep(4000);
                projectSvc.QueuePublish(jobUid, projectId, true, SPContext.Current.Site.Url);
                System.Threading.Thread.Sleep(4000);
    Here is QueueUpdateProject inserted before Publish and checkIn replaced with checkOut

  • Setting Up Earned Value Reporting in Project Server 2010, Using Hours Not Dollars

    Hello All,
    Are there instructions for setting up Project Server 2010 for Earned Value data capture and reporting?  I'm not certain that we are capturing the correct data to report EVM (i.e., Physical % Complete), and I was unable to find any videos on YouTube.
    Also, I noticed that Project Server 2010 defaults to reporting EV in Dollars.  Can we set it up to report in Hours instead?
    Julie  

    Hi Julie,
    If you allow to jump in to complement Dale's excellent reply and comment some of your concern...
    5. The status date is a fundamental parameter while talking about the EVM (it is ANYWAY a key setting for tracking projects with MS Project). The EV field will take into account actuals up to this date. Meaning that if your project plans have been updated
    by the PM on tuesday and you are running the analysis on friday, you set the status date to tuesday and the uncomplete work between tuesday and friday will not be considered as late work since you are running the analysis as of tuesday. The status date can
    be set from the "project" tab either in the project information dialog box or directly in the project tab, status group.
    6. MS Project proposes 3 EVM tables by default. A table is a predefined set of column which composes a view, together with a Gantt chart or a timephased grid. If you go to the view tab, click on "tables" then "more tables",
    you will find EV, EV cost indicators and EV Schedule indicators tables which will display the out of the box EVM fields calculated by MS Project based on the costs, actuals, Baseline, status date.
    Then about the cumulative data, you might be refering to S-curves which are a representation allowing you showing the cumulative values of the EV. To do that, you'll have severals ways:
    Use the cumulative calculated field in the visuals reports
    Create
    Dashboards from the report tab using the cumulative data (actual, Baseline, cost)
    Create
    MDX mesures in the OLAP cubes for cumulative data and create excel reports
    Develop custom SSRS reports
    Buy a 3rd-party addon
    Finally please let me give you an excellent reference for the EVM in MS Project with EPM Central blog articles:
    http://www.epmcentral.com/msproject/evintro.php
    http://www.epmcentral.com/msproject/evprereq.php
    http://www.epmcentral.com/msproject/evterms.php
    http://www.epmcentral.com/msproject/evexplain.php
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Project Server 2013 reporting database change in Schema from Project Server 2010

    I have a current Project Server 2010 implementation, I am planning to migrate to Project Online.
    We have Customized Reports that consume from the PS 2010 Reporting DB.
    Are there differences in the Reporting DB schema  between PS 2010 and Project Online?
    My Question is: if we migrated to Project Online, will the reports crash?
    Another question is that, is PS 2013 Reporting DB schema the same as Project Online?

    Hi Atia,
    IN project server 2013 we have only one database instead of 4, it means draft, archive, published and reporting with in one database.Project Server 2013 reporting database schema tool that can be downloaded.
    http://blogs.msdn.com/b/project_programmability/archive/2013/01/28/project-server-2013-reporting-database-rdb-schema-reference.aspx
    There are differences in reporting of on-premises vs. Project Online
    The Project Server 2013 reporting schema includes three new tables, 27 new views, and a total of 33 tables and views that include new fields.
    Answer-1 : Yes there are some differences between PS 2010 and project Online.
    Answer-2 : Reports will crash as In Project Online you have to use ODATA to create report. You can not query project online data for reporting directly you have to have use ODATA. 
    http://msdn.microsoft.com/en-us/library/jj163015.aspx
    Answer-3 : NO, PS 2013 Schema and Project online Schema is different. 
    kirtesh

  • Project Server 2010 Business Intelligence performance issue

    Hello,
    We've setup a Project Server 2010 Business intelligence center and everything seems to be working fine.
    The next day when users attempt to open Sample reports an error occurs that when we apply the "refresh all Data connections" a couple of times everything works fine.
    How do we ensure that this strange issue of "fake un-related" errors are not occuring for users.
    Once the BI is accessed by a few people then the reports seem to work the first time otherwise if you are the first one running them in the morning you have to retry 4 to 5 times for the excel spreadsheet to show up?

    Hello Claude
    While there is a list to things to double check when configuring Secure Store, I think the first thing I will do is "Set Credentials".   The password may be been changed or if several attempts to using the account is tried, it may have gotten
    locked out.
    CHeers!
    Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
    Website http://www.WhartonComputer.com
    Blog http://MyProjectExpert.com contains my field notes and SQL queries

  • Project Server 2010 - Issue with correct recording of timesheet actual hours with decimals

    We have Project Server 2010 and are using the timesheet functionality for recording resource times/costs in the schedules.
    It has come to light only recently, that for one user, suddenly the times she is entering are not being summed up correctly. An image of her timesheet and the manage timesheet screens are shown below. Note she entered 9.5 hrs but the total that
    appears in the manage timesheet screen is 9.514hrs.
    If you look at the history of the previous weeks as well, the weird change toi the total hours has occurred in the previous 4 weeks as well.  I have no idea why this has started happening and am not aware of any change to the resource's details (apart
    from a change to her hourly rate).
    Has anyone experienced this before? 
    Thanks
    Peter

    We have this issue and are past the patch that discussed decimal rounding (April 2014, though it was more related to the application of resource rates).  This seems different from that noted rounding problem.
     We have at least three users (out of 625) that have this problem every week and it isn't always the same users.  If we re-enter the time and zero fill the cells for the problem task it will fix it. 
    It is almost like when a user deletes a value that it is leaving residual numbers in the field. 
    Our 2010 server version below which is through Sept 2014 CU:
    14.0.7132.5000 
    Any help on this would be appreciated.
    Thanks!

Maybe you are looking for

  • Using a cookie from one application web site to another application

    Hi, I have a big application written in ASP/CF. In this application, I added a link to my small application in CF. Both apps are on the same server but separate websites. I liked to use the user admin functionality that is available in the big applic

  • A Case of a woman scorned...?

    Hopefully people use this as a sign to be more cautious of their online activities. Many people are under the assumption that their secret or personal information is safe because it is behind a password.

  • What is the maximum Hard Drive size that a G3 B/W will recognize

    I have a Disk Utility failed Hard Drive in my B/W G3 Power Mac. The Disk Utility was unable to repair it so I guess I will be in the market to purchase a new one. Is there a maximum size hard Drive that a G3 will recognize? I had an 80 GB drive befor

  • DW8 ANSI Encoding

    Hi I have been compiling some asp files for a forum and there was an issue with displaying the UK £ Pound sign and the resolution was to save the file in the ANSI encoding and not UTF-8 encoding. How can we preset the preferences so that the file for

  • Copying PDF seems to currupt it

    I am copying a pdf from a source directory, then attempting to extract the pdf with pdfbox 0.7.3 the code I am using to copy the file is public static boolean altCopyFile( File source, File dest ) long len = 0; boolean success = false; FileChannel sr